updated on Tue Jan 10 04:01:21 UTC 2012
[aur-mirror.git] / ape-server-git / aped
blob73bdb48ad95be574d736f1782318b06e23db9ea4
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 PID=`pidof -o %PPID /usr/bin/aped`
7 case "$1" in
8 start)
9 stat_busy "Starting AJAX Push Engine"
10 if [ -z "$PID" ]; then
11 date >> /var/log/aped.log
12 /usr/bin/aped --cfg /etc/ape/ape.conf &>>/var/log/aped.log &
14 if [ ! -z "$PID" -o $? -gt 0 ]; then
15 stat_fail
16 else
17 add_daemon aped
18 stat_done
21 stop)
22 stat_busy "Stopping AJAX Push Engine"
23 [ ! -z "$PID" ] && kill $PID &> /dev/null
24 if [ $? -gt 0 ]; then
25 stat_fail
26 else
27 rm_daemon esd
28 stat_done
31 kill)
32 stat_busy "Killing AJAX Push Engine"
33 [ ! -z "$PID" ] && kill -9 $PID &> /dev/null
34 rm_daemon esd
35 stat_done
37 restart)
38 $0 stop
39 sleep 1
40 $0 start
43 echo "usage: $0 {start|stop|restart}"
44 esac