3 # asterix This shell script takes care of starting and stopping
8 # description: callweaver is an Open Source PBX and telephony development platform that \ \
9 # can both replace a conventional PBX and act as a platform for \
10 # developing custom telephony applications for delivering dynamic \
11 # content over a telephone similarly to how one can deliver dynamic \
12 # content through a web browser using CGI and a web server.
14 # pidfile: /var/run/callweaver.pid
15 # config: /etc/callweaver/callweaver.conf
18 # Source function library
19 . /etc/rc.d/init.d/functions
22 . /etc/sysconfig/network
25 CALLWEAVER_REALTIME=yes
30 [ -f /etc/sysconfig/callweaver ] && . /etc/sysconfig/callweaver
32 # Check that networking is up.
33 if is_yes "${NETWORKING}"; then
34 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
35 msg_network_down callweaver
42 REALDAEMON=/usr/sbin/callweaver
43 if is_yes "$CALLWEAVER_SAFE"; then
44 DAEMON=/usr/sbin/safe_callweaver
46 DAEMON=/usr/sbin/callweaver
49 if ! is_yes "$CALLWEAVER_REALTIME"; then
50 CALLWEAVER_OPT="$CALLWEAVER_OPT -p"
54 # See how we were called.
56 # Check if the service is already running?
57 if [ ! -f /var/lock/subsys/callweaver ]; then
58 msg_starting callweaver
59 daemon $DAEMON -U callweaver -G callweaver $CALLWEAVER_OPT
61 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/callweaver
63 msg_already_running callweaver
69 if [ -f /var/lock/subsys/callweaver ]; then
70 msg_stopping callweaver
71 daemon $REALDAEMON -rx 'stop now'
74 killproc callweaver -KILL > /dev/null 2>&1
75 rm -f /var/lock/subsys/callweaver >/dev/null 2>&1
77 msg_not_running callweaver
82 # See how we were called.
95 if [ -f /var/lock/subsys/callweaver ]; then
96 msg_reloading "callweaver configuration"
97 daemon $DAEMON -rx 'reload'
98 # these AFAIK are also reloaded by -rx reload
99 # msg_reloading "callweaver logger"
100 # daemon $DAEMON -rx 'logger reload'
101 # msg_reloading "callweaver extensions"
102 # daemon $DAEMON -rx 'extensions reload'
104 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/callweaver
107 msg_not_running callweaver
112 $DAEMON -rx 'logger reload'
119 msg_usage "$0 {start|stop|restart|force-reload|status}"