updated on Fri Jan 13 20:02:10 UTC 2012
[aur-mirror.git] / anyterm / anytermd.rc.d
blob25efdaf1eb6a293c8f0260e7362d4a45fb79c75b
1 #! /bin/bash
3 ### /etc/rc.d/anytermd: Initscript for Anyterm
5 . /etc/conf.d/anytermd
7 . /etc/rc.conf
8 . /etc/rc.d/functions
10 PID=`pidof -o %PPID /usr/sbin/anytermd`
11 case "$1" in
12 start)
13 stat_busy "Starting Anyterm Daemon"
14 [ -z "$PID" ] && /usr/sbin/anytermd \
15 $ANYTERMD_OPTIONS \
16 -c "$ANYTERMD_COMMAND" &> /dev/null
17 if [ $? -gt 0 ]; then
18 stat_fail
19 else stat_done; add_daemon anytermd
20 echo $PID > /var/run/anytermd.pid
21 fi ;;
22 stop)
23 stat_busy "Stopping Anyterm Daemon"
24 [ ! -z "$PID" ] \
25 && kill $PID &>/dev/null
26 if [ $? -gt 0 ]; then
27 stat_fail
28 else
29 stat_done; rm_daemon anytermd; fi ;;
30 restart)
31 $0 stop
32 sleep 1
33 $0 start ;;
35 echo "usage: $0 {start|stop|restart}"
36 esac
38 exit 0
40 ### /etc/rc.d/anytermd: Initscript for Anyterm