You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
761 B

  1. #!/bin/sh /etc/rc.common
  2. START=99
  3. USE_PROCD=1
  4. start_service()
  5. {
  6. #check if chaosvpn is configured
  7. if [ ! -f "/etc/tinc/chaos/rsa_key.pub" -o ! -f "/etc/tinc/chaos/rsa_key.priv" ]; then
  8. logger -t chaosvpn "please generate rsa key pair"
  9. logger -t chaosvpn "tincd -n chaos --generate-keys=2048"
  10. exit 1
  11. fi
  12. if [ "`grep unique_name /etc/tinc/chaosvpn.conf | wc -l`" != "0" ]; then
  13. logger -t chaosvpn "/etc/tinc/chaosvpn.conf is not configured yet or contains 'unique_name'"
  14. exit 1
  15. fi
  16. procd_open_instance
  17. procd_set_param command /usr/sbin/chaosvpn -r -c /etc/tinc/chaosvpn.conf
  18. procd_close_instance
  19. }
  20. stop_service()
  21. {
  22. #force remove tinc pid
  23. if [ -f "/var/run/tinc.chaos.pid" ]; then
  24. rm "/var/run/tinc.chaos.pid"
  25. fi
  26. }