Add slackware initialization (bug #3900)
authorMark Spencer <markster@digium.com>
Fri, 1 Apr 2005 03:39:45 +0000 (03:39 +0000)
committerMark Spencer <markster@digium.com>
Fri, 1 Apr 2005 03:39:45 +0000 (03:39 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5331 65c4cc65-6c06-0410-ace0-fbb531ad65f3

contrib/init.d/rc.slackware.asterisk [new file with mode: 0755]

diff --git a/contrib/init.d/rc.slackware.asterisk b/contrib/init.d/rc.slackware.asterisk
new file mode 100755 (executable)
index 0000000..6763459
--- /dev/null
@@ -0,0 +1,42 @@
+#!/bin/sh
+#
+# Start/stop/restart Asterisk PBX
+#
+# Version: 1.0 - Paul Belanger <pabelanger@gmail.com>
+#
+# 03.29.2005 - Initial Version
+#
+
+asterisk_start() {
+   if [ -x /usr/sbin/asterisk ]; then
+      echo "Starting Asterisk   /usr/sbin/asterisk"
+      /usr/sbin/asterisk
+   fi
+}
+
+asterisk_stop() {
+    # If there is no PID file, ignore this request...
+    if [ -r /var/run/asterisk.pid ]; then
+      killall asterisk
+    fi
+}
+
+asterisk_restart() {
+   asterisk_stop
+   asterisk_start
+}
+
+case "$1" in
+   'start')
+      asterisk_start
+      ;;
+   'stop')
+      asterisk_stop
+      ;;
+   'restart')
+      asterisk_restart
+      ;;
+   *)
+      echo "usage $0 start|stop|restart" ;;
+esac
+