mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
Executable
+3
@@ -0,0 +1,3 @@
|
||||
[ "$INTERFACE" == "wan" ] || return
|
||||
[ "$ACTION" == "ifup" ] && /etc/init.d/chaosvpn restart
|
||||
|
||||
Executable
+31
@@ -0,0 +1,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
|
||||
}
|
||||
Reference in New Issue
Block a user