updated on Tue Jan 17 08:05:08 UTC 2012
[aur-mirror.git] / capisuite / capisuite.rcd
blob87d12b27b11f525a1b028bd948e5ecfc34bdb7bf
1 #!/bin/bash
3 daemon_name=capisuite
5 . /etc/rc.conf
6 . /etc/rc.d/functions
8 PID=`pidof -o %PPID /usr/local/sbin/capisuite`
9 case "$1" in
10 start)
11 ck_depends 'capiinit'
13 stat_busy "Starting Capisuite"
14 [ -z "$PID" ] && /usr/local/sbin/capisuite -d
15 if [ $? -gt 0 ]; then
16 stat_fail
17 else
18 add_daemon $daemon_name
19 pidof -o %PPID /usr/local/sbin/capisuite > /var/run/$daemon_name.pid
20 stat_done
24 stop)
25 stat_busy "Stopping Capisuite"
26 [ ! -z "$PID" ] && kill $PID /usr/local/sbin/capisuite &> /dev/null
27 if [ $? -gt 0 ]; then
28 stat_fail
29 else
30 rm_daemon $daemon_name
31 rm /var/run/$daemon_name.pid
32 stat_done
36 reload)
37 stat_busy "Reloading Capisuite"
38 [ ! -z "$PID" ] && kill -HUP $PID /usr/local/sbin/capisuite &> /dev/null
39 if [ $? -gt 0 ]; then
40 stat_fail
41 else
42 stat_done
46 restart)
47 stat_busy "Restarting Capisuite"
48 $0 stop
49 sleep 1
50 $0 start
52 status)
53 stat_busy "Checking Capisuite status";
54 ck_status $daemon_name
58 echo "usage: $0 {start|stop|reload|restart|status}"
59 esac
61 exit 0