]> git.pld-linux.org Git - packages/asterisk.git/blobdiff - asterisk.init
- up to 1.0.2
[packages/asterisk.git] / asterisk.init
index adb2494a36e001e07f560c379544ccfbc3a808e0..ff410d77e3d67100838ac5b835bfbdfc8d5223a2 100644 (file)
@@ -5,10 +5,10 @@
 #
 # chkconfig:   345 90 25
 #
-# description: Asterisk is an Open Source PBX and telephony development platform that
-#              can both replace a conventional PBX and act as a platform for
-#              developing custom telephony applications for delivering dynamic
-#              content over a telephone similarly to how one can deliver dynamic
+# description: Asterisk is an Open Source PBX and telephony development platform that \ \
+#              can both replace a conventional PBX and act as a platform for \
+#              developing custom telephony applications for delivering dynamic \
+#              content over a telephone similarly to how one can deliver dynamic \
 #              content through a web browser using CGI and a web server.
 #              
 # pidfile:     /var/run/asterisk.pid
@@ -26,7 +26,7 @@
 
 # Check that networking is up.
 if is_yes "${NETWORKING}"; then
-       if [ ! -f /var/lock/subsys/network ]; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
                msg_network_down Asterisk
                exit 1
        fi
@@ -37,6 +37,7 @@ fi
 # Sanity check
 [ -f /etc/asterisk/asterisk.conf ] || exit 0
 
+RETVAL=0
 # See how we were called.
 case "$1" in
   start)
@@ -65,18 +66,19 @@ case "$1" in
        $0 start
        exit $?
        ;;
-#  reload)
-       # Should be some better way...
-#      $0 restart
-#      if [ -f /var/lock/subsys/ ]; then
-#              msg_reloading Asterisk
-#              busy
-#              ok
-#      else
-#              msg_not_running Asterisk
-#              exit 1
-#      fi
-#      ;;
+  reload)
+       if [ -f /var/lock/subsys/asterisk ]; then
+               msg_reloading Asterisk
+               busy
+               asterisk -rx reload > /dev/null 2>&1
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/asterisk
+               ok
+       else
+               msg_not_running Asterisk
+               exit 1
+       fi
+       ;;
   status)
        status asterisk
        exit $?
This page took 0.067842 seconds and 4 git commands to generate.