Add ebuild for cjdns
This commit is contained in:
32
net-p2p/cjdns/files/cjdns.runscript
Normal file
32
net-p2p/cjdns/files/cjdns.runscript
Normal 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 $?
|
||||
}
|
Reference in New Issue
Block a user