From 9088da5f2dc47ac8fb7b6a7add6bd6d970e97cfd Mon Sep 17 00:00:00 2001 From: Nicolás Reynolds Date: Tue, 6 Sep 2011 02:06:11 -0300 Subject: social/opentracker-20110831-1 --- social/opentracker/opentracker.rc.d | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 social/opentracker/opentracker.rc.d (limited to 'social/opentracker/opentracker.rc.d') diff --git a/social/opentracker/opentracker.rc.d b/social/opentracker/opentracker.rc.d new file mode 100755 index 000000000..b1aa34c14 --- /dev/null +++ b/social/opentracker/opentracker.rc.d @@ -0,0 +1,37 @@ +#!/bin/bash + +# general config +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/bin/opentracker` + +case "$1" in + start) + stat_busy "Starting opentracker Daemon" + [ -z "$PID" ] && su nobody -s /bin/sh -c "/usr/bin/opentracker -f /etc/opentracker/config&" + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon opentracker + stat_done + fi + ;; + stop) + stat_busy "Stopping opentracker Daemon" + [ ! -z "$PID" ] && kill $PID &>/dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon opentracker + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac -- cgit v1.2.3