mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
6007ad6861
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
40 lines
493 B
Bash
40 lines
493 B
Bash
#!/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
|