cjdns.initd (602B)
1 #!/sbin/openrc-run
2 description="Encrypted networking for regular people."
3
4 CONFFILE=/etc/cjdroute.conf
5
6 command="/usr/sbin/cjdroute"
7
8 depend() {
9 use net dns
10 after precursor
11 }
12
13 start() {
14 if [ ! -e /dev/net/tun ]; then
15 ebegin "Inserting TUN module"
16
17 if ! modprobe tun; then
18 eerror "Failed to insert TUN kernel module"
19 exit 1
20 fi
21 fi
22
23 ebegin "Starting CJDNS"
24 start-stop-daemon --start --quiet --exec "${command}" -- < "${CONFFILE}"
25 eend $?
26 }
27
28 stop() {
29 ebegin "Stopping CJDNS"
30 start-stop-daemon --stop --exec "${command}"
31 eend $?
32 }