updated on Sat Jan 21 04:00:54 UTC 2012
[aur-mirror.git] / shellinabox / shellinaboxd.rc.d
blob33999458272ae11b10dc2f9bd26a0ab2bc83229f
1 #!/bin/bash
2 . /etc/rc.conf
3 . /etc/rc.d/functions
5 SHELLINABOXD_ARGS=
6 [ -f /etc/conf.d/shellinaboxd ] && . /etc/conf.d/shellinaboxd
8 PID=`pidof -o %PPID /usr/bin/shellinaboxd`
9 case "$1" in
10 start)
11 stat_busy "Starting SHELLINABOXD"
12 [ -z "$PID" ] && /usr/bin/shellinaboxd ${SHELLINABOXD_ARGS}
13 if [ $? -gt 0 ]; then
14 stat_fail
15 else
16 add_daemon shellinaboxd
17 stat_done
20 stop)
21 stat_busy "Stopping SHELLINABOXD"
22 [ ! -z "$PID" ] && kill $PID &> /dev/null
23 if [ $? -gt 0 ]; then
24 stat_fail
25 else
26 rm_daemon shellinboxd
27 stat_done
30 restart)
31 $0 stop
32 $0 start
35 echo "usage: $0 {start|stop|restart}"
36 esac
37 exit 0