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