-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmsbox.init
executable file
·82 lines (70 loc) · 1.34 KB
/
smsbox.init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#!/bin/bash
#
# chkconfig: 2345 98 03
# description: Kannel WAP/SMS gateway smsbox.
# processname: /usr/sbin/smsbox
# pidfile: /var/run/smsbox.pid
#
# probe: true
CONF=/etc/kannel/smskannel.conf
WITHOUT_RC_COMPAT=1
. /etc/init.d/functions
LOCKFILE=/var/lock/subsys/smsbox
PIDFILE=/var/run/kannel/smsbox.pid
RETVAL=0
SourceIfExists /etc/sysconfig/kannel
start()
{
# nginx can work with many files at one time
[ -n "$ULIMIT_ARGS" ] && ulimit $ULIMIT_ARGS
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user kannel --name smsbox -- smsbox -p "$PIDFILE" -u kannel -d $CONF
RETVAL=$?
return $RETVAL
}
stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user kannel --name smsbox -- smsbox
RETVAL=$?
return $RETVAL
rm -f $PIDFILE
}
restart()
{
stop
start
RETVAL=$?
return $RETVAL
}
# See how we were called.
case "$1" in
start)
sleep 2 # wait for bearerbox to start
RETVAL=$?
[ $RETVAL -eq 0 ] && start ||:
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status --lockfile "$LOCKFILE" --pidfile "$PIDFILE" --expect-user kannel -- smsbox
RETVAL=$?
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
*)
msg_usage "kannel.smsbox {start|stop|restart|status|condstop|condrestart}"
RETVAL=1
esac
exit $RETVAL