summaryrefslogtreecommitdiff
path: root/network/hamachi/rc.hamachi
diff options
context:
space:
mode:
authorAdam Swift <vikepack@omnitude.net>2011-03-06 12:09:10 -0300
committerNiels Horn <niels.horn@slackbuilds.org>2011-03-06 12:09:10 -0300
commit00549051450f13800ace57ec6415ef5629d41546 (patch)
tree7d9646383c9c0089744738f6c5a6d1ced30933b2 /network/hamachi/rc.hamachi
parent2fbb29de1a632e8e7dfd689597c91c524dc761aa (diff)
downloadslackbuilds-00549051450f13800ace57ec6415ef5629d41546.tar.gz
network/hamachi: Added (LogMeIn VPN client)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'network/hamachi/rc.hamachi')
-rw-r--r--network/hamachi/rc.hamachi36
1 files changed, 36 insertions, 0 deletions
diff --git a/network/hamachi/rc.hamachi b/network/hamachi/rc.hamachi
new file mode 100644
index 0000000000..a3398f1051
--- /dev/null
+++ b/network/hamachi/rc.hamachi
@@ -0,0 +1,36 @@
+#!/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
+