summarylogtreecommitdiffstats
path: root/hop
diff options
context:
space:
mode:
Diffstat (limited to 'hop')
-rwxr-xr-xhop43
1 files changed, 43 insertions, 0 deletions
diff --git a/hop b/hop
new file mode 100755
index 000000000000..d19023852354
--- /dev/null
+++ b/hop
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+HOP_OPTS=-v2
+HOP=/usr/bin/hop
+HOP_PORT=8080
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+if [ -f /etc/conf.d/hop ]; then
+ . /etc/conf.d/hop
+fi
+
+case "$1" in
+ start)
+ stat_busy "Starting Hop service"
+ $HOP -p $HOP_PORT --accept-kill $HOP_OPTS &> /dev/null 2> /var/log/hop.log &
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon hop
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Hop service"
+ $HOP -p $HOP_PORT --kill &> /dev/null &
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon hop
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+ ;;
+esac