updated on Tue Jan 10 00:10:07 UTC 2012
[aur-mirror.git] / hula / hula-script
blobccfd52aba709cfbc925cb6fb0f31e6af4c607629
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 DAEMON_NAME="hulamanager"
7 DAEMON_PATH="/usr/sbin/${DAEMON_NAME}"
9 PID=`pidof -o %PPID ${DAEMON_NAME}`
10 case "$1" in
11 start)
12 stat_busy "Starting ${DAEMON_NAME}"
13 [ -z "$PID" ] && ${DAEMON_PATH} -d
14 if [ $? -gt 0 ]; then
15 stat_fail
16 else
17 add_daemon ${DAEMON_NAME}
18 stat_done
21 stop)
22 stat_busy "Stopping ${DAEMON_NAME}"
23 [ ! -z "$PID" ] && ${DAEMON_PATH} --stop &>/dev/null
24 if [ $? -gt 0 ]; then
25 stat_fail
26 else
27 rm_daemon ${DAEMON_NAME}
28 stat_done
31 restart)
32 $0 stop
33 sleep 3
34 $0 start
37 echo "usage: $0 {start|stop|restart}"
38 esac
39 exit 0