updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / verlihub / verlihubd
blob8c16abee30995ef96e3f3ce140692e809cc8b33c
1 #!/bin/bash
2 [ -f /etc/conf.d/verlihub ] && . /etc/conf.d/verlihub
3 . /etc/rc.conf
4 . /etc/rc.d/functions
5 PID=`pidof -o %PPID /usr/bin/verlihub`
6 case "$1" in
7 start)
8 stat_busy "Starting verlihub"
9 if [ -z "$PID" ]; then
10 /usr/bin/verlihub --start --quiet --background &>/dev/null &
11 if [ $? -gt 0 ]; then
12 stat_fail
13 exit 1
14 else
15 sleep 1 # wait on children
16 echo `pidof -o %PPID /usr/bin/verlihub` >/var/run/verlihub.pid
17 add_daemon verlihub
18 stat_done
20 else
21 stat_fail
22 exit 1
26 stop)
27 stat_busy "Stopping verlihub"
28 if [ ! -z "$PID" ]; then
29 kill $PID &> /dev/null
30 if [ $? -gt 0 ]; then
31 stat_fail
32 exit 1
33 else
34 rm -f /var/run/verlihub.pid &>/dev/null
35 rm_daemon verlihub
36 stat_done
38 else
39 stat_fail
40 exit 1
44 restart)
45 $0 stop
46 sleep 3
47 $0 start
50 echo "usage: $0 {start|stop|restart}"
51 esac
52 exit 0