mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-25 10:03:03 +01:00
0054905145
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
36 lines
592 B
Bash
36 lines
592 B
Bash
#!/bin/bash
|
|
# Start/stop/restart the hamachi "zero-conf" VPN service
|
|
HAMACHI_DIR=/usr/share/hamachi
|
|
|
|
hamachi_start() {
|
|
# ensure the tun driver is loaded- hamachi fails to start if it is not
|
|
/sbin/modprobe tun
|
|
$HAMACHI_DIR/hamachid
|
|
}
|
|
|
|
hamachi_stop() {
|
|
if [ -e "/var/run/logmein-hamachi/hamachid.pid" ]; then
|
|
kill `cat /var/run/logmein-hamachi/hamachid.pid`
|
|
fi
|
|
}
|
|
|
|
hamachi_restart() {
|
|
hamachi_stop
|
|
sleep 1
|
|
hamachi_start
|
|
}
|
|
|
|
case "$1" in
|
|
'start')
|
|
hamachi_start
|
|
;;
|
|
'stop')
|
|
hamachi_stop
|
|
;;
|
|
'restart')
|
|
hamachi_restart
|
|
;;
|
|
*)
|
|
echo "usage $0 start|stop|restart"
|
|
esac
|
|
|