updated on Thu Jan 26 16:09:46 UTC 2012
[aur-mirror.git] / kannel / rc.wapbox
blob4efb452fe568eb2a86f51c1c23dd790a6817bc28
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 boxexec=wapbox
7 boxexec_full_path=/usr/sbin/$boxexec
8 configfile_path=/etc/kannel/kannel.conf
9 pidfile=/var/run/$boxexec.pid
12 CMD="/usr/sbin/run_kannel_box --pidfile $pidfile --min-delay 5 $boxexec_full_path $configfile_path"
13 PID=$(cat $pidfile 2>/dev/null)
15 case "$1" in
16 start)
17 stat_busy "Starting $boxexec"
18 [ -z "$PID" ] && $CMD &> /dev/null
19 if [ $? -gt 0 ]; then
20 stat_fail
21 else
22 add_daemon $boxexec
23 stat_done
26 stop)
27 stat_busy "Stopping $boxexec"
28 [ ! -z "$PID" ] && kill $PID &> /dev/null
29 if [ $? -gt 0 ]; then
30 stat_fail
31 else
32 rm_daemon $boxexec
33 stat_done
36 restart)
37 $0 stop
38 sleep 1
39 $0 start
42 echo "usage: $0 {start|stop|restart}"
43 esac
44 exit 0