forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
kannel-initd
68 lines (56 loc) · 1.49 KB
/
kannel-initd
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
#!/sbin/runscript
depend() {
need net
after mysql postgresql sshd
}
checkconfig() {
if [ ! -f /etc/kannel/kannel.conf ] ; then
eerror "/etc/kannel/kannel.conf file doesn't exists!"
return 1
fi
#set the location of logs
if ! cd /var/log/kannel ; then
eerror "/var/log/kannel directory doesn't exists!"
return 1
fi
}
start() {
checkconfig || return 1
einfo "Starting Kannel"
ebegin " - Bearer Box"
start-stop-daemon --start --quiet --chuid kannel --exec /usr/sbin/bearerbox \
--background -- $BEARERBOX_OPTS /etc/kannel/kannel.conf
eend $? || return 1
if [ "$START_SMSBOX" = "yes" ] ; then
ebegin " - SMS Box"
start-stop-daemon --start --quiet --chuid kannel --exec /usr/sbin/smsbox \
--background -- $SMSBOX_OPTS /etc/kannel/kannel.conf
eend $?
fi
if [ "$START_WAPBOX" = "yes" ] ; then
ebegin " - WAP Box"
start-stop-daemon --start --quiet --chuid kannel --exec /usr/sbin/wapbox \
--background -- $WAPBOX_OPTS /etc/kannel/kannel.conf
eend $?
fi
return 0
}
stop() {
if [ "$START_WAPBOX" = "yes" ] ; then
einfo "Stopping Kannel"
ebegin " - WAP Box"
start-stop-daemon --stop --quiet --exec /usr/sbin/wapbox
eend $?
fi
if [ "$START_SMSBOX" = "yes" ] ; then
ebegin " - SMS Box"
start-stop-daemon --stop --quiet --exec /usr/sbin/smsbox
eend $?
fi
ebegin " - Bearer Box"
start-stop-daemon --stop --quiet --exec /usr/sbin/bearerbox
eend $?
#stopping any other processes owned by kannel user
start-stop-daemon --stop --quiet --user kannel
return 0
}