updated on Thu Jan 19 20:01:47 UTC 2012
[aur-mirror.git] / kannel-mbuni / rc.wapbox
blob6f21c6723c8927907fd21a13390c6e4f7d9eb0c3
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.conf
10 CMD="/usr/sbin/run_kannel_box $boxexec_full_path $configfile_path"
11 PID=`pidof -o %PPID $CMD`
13 case "$1" in
14 start)
15 stat_busy "Starting $boxexec"
16 [ -z "$PID" ] && $CMD &> /dev/null
17 if [ $? -gt 0 ]; then
18 stat_fail
19 else
20 add_daemon $boxexec
21 stat_done
24 stop)
25 stat_busy "Stopping $boxexec"
26 [ ! -z "$PID" ] && kill $PID &> /dev/null
27 if [ $? -gt 0 ]; then
28 stat_fail
29 else
30 rm_daemon $boxexec
31 stat_done
34 restart)
35 $0 stop
36 sleep 1
37 $0 start
40 echo "usage: $0 {start|stop|restart}"
41 esac
42 exit 0