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