3 # asterix This shell script takes care of starting and stopping
8 # description: Asterisk 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/asterisk.pid
15 # config: /etc/asterisk/asterisk.conf
18 # Source function library
19 . /etc/rc.d/init.d/functions
22 . /etc/sysconfig/network
25 [ -f /etc/sysconfig/asterisk ] && . /etc/sysconfig/asterisk
27 # Check that networking is up.
28 if is_yes "${NETWORKING}"; then
29 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
30 msg_network_down Asterisk
38 [ -f /etc/asterisk/asterisk.conf ] || exit 0
41 # See how we were called.
44 # Check if the service is already running?
45 if [ ! -f /var/lock/subsys/asterisk ]; then
47 daemon $SERVICE_RUN_NICE_LEVEL asterisk $ASTERISK_OPTS
49 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/asterisk
51 msg_already_running Asterisk
56 if [ -f /var/lock/subsys/asterisk ]; then
59 rm -f /var/lock/subsys/asterisk >/dev/null 2>&1
61 msg_not_running Asterisk
70 # Should be some better way...
72 # if [ -f /var/lock/subsys/ ]; then
73 # msg_reloading Asterisk
77 # msg_not_running Asterisk
86 msg_usage "$0 {start|stop|restart|force-reload|status}"