aboutsummaryrefslogtreecommitdiff
path: root/network/tinc/rc.tinc
blob: d163c22973b494afb5bc699f043f344344d851c0 (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
32
33
34
35
36
37
38
39
40
#!/bin/sh
 
VPNS=$(ls /etc/tinc)
 
start () {
	for VPN in $VPNS; do
		echo "Starting tinc daemon for $VPN..."
		/usr/sbin/tincd -n "$VPN" -d1 --logfile=/var/log/tinc."$VPN"
	done
}
 
stop () {
	for VPN in $VPNS; do
		echo "Stopping tinc daemon for $VPN..."
		/usr/sbin/tincd -n "$VPN"  -k
	done
}
 
restart () {
	stop
	sleep 1
	start
}
 
case "$1" in
	("start")
		start
		;;
	("stop")
		stop
		;;
	("restart")
		restart
		;;
	(*)
		echo "Usage: $0 <start|stop|restart>"
		exit 1
esac
 
exit 0