updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / regina-rexx-das / rc.d_rxstack
blob3886b05d018ab00f4170b32608986ea14668c5ea
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=$(pidof -o %PPID /usr/bin/rxstack)
8 stat_started() {
9 deltext
10 printf "${C_OTHER}[${C_DONE}STARTED${C_OTHER}]${C_CLEAR} \n"
13 stat_stopped() {
14 deltext
15 printf "${C_OTHER}[${C_DONE}STOPPED${C_OTHER}]${C_CLEAR} \n"
18 case "$1" in
19 start)
20 stat_busy "Starting Regina Stack"
21 [ -z "${PID}" ] && /usr/bin/rxstack -d &> /dev/null
22 if [ $? -gt 0 ]; then
23 stat_fail
24 else
25 add_daemon rxstack
26 stat_done
29 stop)
30 stat_busy "Stopping Regina Stack"
31 /usr/bin/rxstack -k &> /dev/null
32 if [ $? -gt 0 ]; then
33 stat_fail
34 else
35 rm_daemon rxstack
36 stat_done
39 status)
40 stat_busy "Regina Stack"
41 echo -en '\b\b\b\b'
42 [ -z "${PID}" ] && stat_stopped
43 [ -z "${PID}" ] || stat_started
45 restart)
46 $0 stop
47 sleep 1
48 $0 start
51 echo "usage: $0 {start|stop|status|restart}"
52 esac
53 exit 0