12345678910111213141516171819202122232425262728293031 |
- #!/bin/sh /etc/rc.common
- START=99
- USE_PROCD=1
- start_service()
- {
- #check if chaosvpn is configured
- if [ ! -f "/etc/tinc/chaos/rsa_key.pub" -o ! -f "/etc/tinc/chaos/rsa_key.priv" ]; then
- logger -t chaosvpn "please generate rsa key pair"
- logger -t chaosvpn "tincd -n chaos --generate-keys=2048"
- exit 1
- fi
- if [ "`grep unique_name /etc/tinc/chaosvpn.conf | wc -l`" != "0" ]; then
- logger -t chaosvpn "/etc/tinc/chaosvpn.conf is not configured yet or contains 'unique_name'"
- exit 1
- fi
- procd_open_instance
- procd_set_param command /usr/sbin/chaosvpn -r -c /etc/tinc/chaosvpn.conf
- procd_close_instance
- }
- stop_service()
- {
- #force remove tinc pid
- if [ -f "/var/run/tinc.chaos.pid" ]; then
- rm "/var/run/tinc.chaos.pid"
- fi
- }
|