blob: f847a9aa49158bc929cb83cb25e8f52b90ace1b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
#!/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
}
|