updated on Wed Jan 11 12:00:27 UTC 2012
[aur-mirror.git] / kannel-mbuni / rc.bearerbox
blob1481f5da4e04f8e37fd4ceaded4f3bae8de236c7
1 #!/bin/bash
3 . /etc/rc.conf
4 . /etc/rc.d/functions
6 boxexec=bearerbox
7 boxexec_full_path=/usr/sbin/$boxexec
8 configfile_path=/etc/kannel/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