]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - src/initscripts/init.d/asterisk
httpscert: Increase size of the RSA key to 4096.
[people/teissler/ipfire-2.x.git] / src / initscripts / init.d / asterisk
index 223c016888f98e2691f699dcb6293bfc5b90e54f..aac9a637ef881a89ef84cc0ac79bfe912ffab71f 100644 (file)
 case "${1}" in
        start)
                boot_mesg "Starting Asterisk PBX..."
-               loadproc /usr/sbin/asterisk
+               loadproc /usr/sbin/asterisk -p
                ;;
 
        stop)
                boot_mesg "Stopping Asterisk PBX..."
-               asterisk -rx "stop gracefully" >/dev/null 2>&1
+               asterisk -rx "core stop gracefully" >/dev/null 2>&1
                evaluate_retval
                ;;
 
@@ -40,11 +40,28 @@ case "${1}" in
                ;;
 
        status)
-               statusproc /usr/sbin/asterisk
+               statusproc /usr/sbin/asterisk > /tmp/ast 2>&1
+               STAT=$(cat /tmp/ast)
+               rm -f /tmp/ast
+               echo $STAT
+               EX_Z=$(echo $STAT | grep "not" | wc -l)
+               exit $EX_Z
+               ;;
+
+       remod)
+               case "${2}" in
+                       sip)asterisk -rx "sip reload" >/dev/null 2>&1 ;;
+                       iax)asterisk -rx "iax2 reload" >/dev/null 2>&1 ;;
+                       ext)asterisk -rx "dialplan reload" >/dev/null 2>&1 ;;
+                       *) echo "Usage: ${0} remod {sip|iax|ext}"; exit 1 ;;
+               esac
+               ;;
+
+       test) touch /tmp/test$$
                ;;
 
        *)
-               echo "Usage: ${0} {start|stop|reload|restart|status}"
+               echo "Usage: ${0} {start|stop|reload|restart|status|remod}"
                exit 1
                ;;
 esac