cjdns 549 B

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