3 # kannel: This shell script takes care of starting and stopping
4 # the Kannel WAP gateway
6 # Author: Maciej Witkowiak <ytm@elysium.pl>
8 # description: start and stop the Kannel WAP gateway used to fetch \
9 # some WML content from a web server and compile it into \
10 # WMLC mobile phone bytecode.
11 # processname: bearerbox
12 # config: /etc/sysconfig/kannel
15 [ -x /usr/sbin/bearerbox ] || exit 0
16 [ -x /usr/sbin/wapbox ] || exit 0
18 # Source function library.
19 . /etc/rc.d/init.d/functions
21 # Source network configuration
22 . /etc/sysconfig/network
25 CONFIGFILE=/etc/kannel/kannel.conf
26 [ -f /etc/sysconfig/kannel ] && . /etc/sysconfig/kannel
28 # Check that networking is up
29 if is_yes "${NETWORKING}"; then
30 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status -a "$1" != init ]; then
31 msg_network_down Kannel
38 STARTER="/usr/sbin/run_kannel_box"
40 # See how we were called.
43 if [ ! -f /var/lock/subsys/kannel ]; then
44 msg_starting "Kannel gateway (bearerbox)"
45 daemon "$STARTER" /usr/sbin/bearerbox -- $CONFIGFILE
47 msg_starting "Kannel gateway (wapbox)"
48 daemon "$STARTER" /usr/sbin/wapbox -- $CONFIGFILE
50 [ $RETVAL1 -eq 0 -a $RETVAL2 -eq 0 ] && touch /var/lock/subsys/kannel ||\
53 msg_already_running "Kannel gateway"
58 if [ -f /var/lock/subsys/kannel ]; then
59 msg_stopping "Kannel gateway"
61 rm -f /var/lock/subsys/kannel >/dev/null 2>&1
63 msg_not_running "Kannel gateway"
76 msg_usage "$0 {start|stop|status|restart|reload}"