Add ebuild for cjdns

This commit is contained in:
2017-08-01 17:06:23 +03:00
parent 30bec57edf
commit 8722a1ab66
3 changed files with 139 additions and 0 deletions

View File

@ -0,0 +1,32 @@
#!/sbin/openrc-run
description="Encrypted networking for regular people."
CONFFILE=/etc/cjdroute.conf
command="/usr/sbin/cjdroute"
depend() {
use net dns
after precursor
}
start() {
if [ ! -e /dev/net/tun ]; then
ebegin "Inserting TUN module"
if ! modprobe tun; then
eerror "Failed to insert TUN kernel module"
exit 1
fi
fi
ebegin "Starting CJDNS"
start-stop-daemon --start --quiet --exec "${command}" -- < "${CONFFILE}"
eend $?
}
stop() {
ebegin "Stopping CJDNS"
start-stop-daemon --stop --exec "${command}"
eend $?
}