1
0

cjdns.conf 1023 B

12345678910111213141516171819202122232425262728
  1. description "cjdns startup script"
  2. author "Sergey Davidoff <shnatsel@gmail.com>"
  3. start on (local-filesystems and net-device-up IFACE!=lo)
  4. stop on runlevel [!2345]
  5. # respawn cjdns if it crashes, but no more than once in 180 seconds
  6. respawn
  7. respawn limit 2 300
  8. pre-start script
  9. if ! [ -e /etc/cjdroute.conf ]; then
  10. ( # start a subshell to avoid side effects of umask later on
  11. umask 077 # to create the file with 600 permissions without races
  12. /usr/bin/cjdroute --genconf > /etc/cjdroute.conf
  13. ) # exit subshell; umask no longer applies
  14. echo 'WARNING: A new cjdns cjdroute.conf file has been generated.'
  15. fi
  16. # If you need a non-standard setup, as described in
  17. # https://github.com/cjdelisle/cjdns#non-standard-setups,
  18. # you should add the commands to be run on every boot here.
  19. # You'll also have to add a "setuid" stanza to this file,
  20. # see http://upstart.ubuntu.com/cookbook/#setuid
  21. end script
  22. exec /usr/bin/cjdroute --nobg < /etc/cjdroute.conf