[asterisk-commits] qwell: trunk r157460 - in /trunk: Makefile contrib/init.d/rc.archlinux.asterisk

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 18 15:01:47 CST 2008


Author: qwell
Date: Tue Nov 18 15:01:46 2008
New Revision: 157460

URL: http://svn.digium.com/view/asterisk?view=rev&rev=157460
Log:
Add init script for ArchLinux

(closes issue #13667)
Reported by: sherif
Patches:
      archlinux_rc_makefile.patch uploaded by sherif (license 591)
      archlinux_rc_makefile-2.patch uploaded by mvanbaak (license 7)

Added:
    trunk/contrib/init.d/rc.archlinux.asterisk   (with props)
Modified:
    trunk/Makefile

Modified: trunk/Makefile
URL: http://svn.digium.com/view/asterisk/trunk/Makefile?view=diff&rev=157460&r1=157459&r2=157460
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Tue Nov 18 15:01:46 2008
@@ -811,6 +811,9 @@
 		elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
 			$(INSTALL) -m 755 contrib/init.d/rc.suse.asterisk $(DESTDIR)/etc/init.d/asterisk; \
 			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
+		elif [ -f /etc/arch-release -o -f /etc/arch-release ]; then \
+			$(INSTALL) -m 755 contrib/init.d/rc.archlinux.asterisk $(DESTDIR)/etc/rc.d/asterisk; \
+			echo "Archlinux is not currently supported, although an init script does exits for it. please add asterisk to your DAEMONS line in /etc/rc.conf to start it when computer boots."; \
 		elif [ -f /etc/slackware-version ]; then \
 			echo "Slackware is not currently supported, although an init script does exist for it." \
 		else \

Added: trunk/contrib/init.d/rc.archlinux.asterisk
URL: http://svn.digium.com/view/asterisk/trunk/contrib/init.d/rc.archlinux.asterisk?view=auto&rev=157460
==============================================================================
--- trunk/contrib/init.d/rc.archlinux.asterisk (added)
+++ trunk/contrib/init.d/rc.archlinux.asterisk Tue Nov 18 15:01:46 2008
@@ -1,0 +1,46 @@
+#!/bin/bash
+#
+# Start/stop/restart Asterisk PBX
+#
+# Version: 0.1 by Sherif Nagy AKA DarKnesS_WolF <sherif.nagy at gmail.com> BASED ON THE SLACKWARE INIT SCRIPT
+#
+# 10.10.2008 - Initial Version
+#
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+case "$1" in
+  start)
+    stat_busy "Starting Asterisk..."
+    if [ -x /usr/sbin/asterisk ]; then
+      # Check if Asterisk is already running.  If it is, then bug out, because
+      # starting safe_asterisk when Asterisk is running is very bad.
+      VERSION=`/usr/sbin/asterisk -rx 'core show version'`
+      if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
+         echo "Asterisk is already running.  $0 will exit now."
+         exit 1
+      fi
+      /usr/sbin/asterisk
+      stat_done
+    fi
+    ;;
+  stop)
+    if [ -r /var/run/asterisk.pid ]; then
+      stat_busy "Stoping Asterisk..."
+      asterisk -rx "core stop now" > /dev/null 2&>1
+      if [ $? -gt 0 ]; then
+        stat_fail
+      else
+        stat_done
+      fi
+    fi
+    ;;
+  restart)
+    $0 stop
+    sleep 2
+    $0 start
+    ;;
+  *)
+    echo "usage $0 start|stop|restart" ;;
+esac
+exit 0

Propchange: trunk/contrib/init.d/rc.archlinux.asterisk
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: trunk/contrib/init.d/rc.archlinux.asterisk
------------------------------------------------------------------------------
    svn:keywords = Author Date Id Revision

Propchange: trunk/contrib/init.d/rc.archlinux.asterisk
------------------------------------------------------------------------------
    svn:mime-type = text/plain




More information about the asterisk-commits mailing list