summaryrefslogtreecommitdiff
path: root/packages/asterisk/asterisk-1.4.19.1/init
diff options
context:
space:
mode:
authorStelios Koroneos <skoroneos@digital-opsis.com>2008-05-01 13:43:48 +0000
committerStelios Koroneos <skoroneos@digital-opsis.com>2008-05-01 13:43:48 +0000
commit6827eda9aeb9ea33d9ca56bf864b7b0605e0447d (patch)
tree6025d86bc0cec366692fdb6864da7b25cef2cd36 /packages/asterisk/asterisk-1.4.19.1/init
parent93c598646b4a192331b77816048fbde223f57924 (diff)
parent4677e9577829e07467b025e476c9ec96d00fb21f (diff)
merge of '9bb9579fd7698d62103b3f88f6d0910f8ba1e53d'
and 'd8f83de5204562e9c23bd329d59d35006de0f0f8'
Diffstat (limited to 'packages/asterisk/asterisk-1.4.19.1/init')
-rw-r--r--packages/asterisk/asterisk-1.4.19.1/init77
1 files changed, 77 insertions, 0 deletions
diff --git a/packages/asterisk/asterisk-1.4.19.1/init b/packages/asterisk/asterisk-1.4.19.1/init
new file mode 100644
index 0000000000..d53a9a1e5e
--- /dev/null
+++ b/packages/asterisk/asterisk-1.4.19.1/init
@@ -0,0 +1,77 @@
+#! /bin/sh
+#
+# This is an init script for openembedded
+# Copy it to /etc/init.d/callweaver and type
+# > update-rc.d asterisk defaults 60
+#
+asterisk=/usr/sbin/asterisk
+pidfile=/var/run/asterisk/asterisk.pid
+asterisk_args="-npqT -U asterisk -G asterisk"
+
+test -x "$asterisk" || exit 0
+
+case "$1" in
+ start)
+ echo -n "Starting Asterisk"
+ start-stop-daemon --start --quiet --exec $asterisk -- $asterisk_args
+ echo "."
+ ;;
+ stop)
+ echo -n "Stopping Asterisk"
+ $asterisk -rx "stop gracefully"
+ sleep 4
+ if [ -f $pidfile ]; then
+ start-stop-daemon --stop --quiet --pidfile $pidfile
+ fi
+ echo "."
+ ;;
+ force-stop)
+ echo -n "Stopping Asterisk"
+ $asterisk -rx "stop now"
+ sleep 2
+ if [ -f $pidfile ]; then
+ start-stop-daemon --stop --quiet --pidfile $pidfile
+ fi
+ echo "."
+ ;;
+ restart)
+ echo -n "Restarting Asterisk"
+ if [ -f $pidfile ]; then
+ $asterisk -rx "restart gracefully"
+ sleep 2
+ else
+ start-stop-daemon --start --quiet --exec $asterisk -- $asterisk_args
+ fi
+ echo "."
+ ;;
+ force-restart)
+ echo -n "Forcibly Restarting Asterisk"
+ if [ -f $pidfile ]; then
+ $asterisk -rx "restart now"
+ sleep 2
+ else
+ start-stop-daemon --start --quiet --exec $asterisk -- $asterisk_args
+ fi
+ echo "."
+ ;;
+ reload)
+ echo -n "Reloading Asterisk Configuration"
+ if [ -f $pidfile ]; then
+ $asterisk -rx "reload"
+ else
+ start-stop-daemon --start --quiet --exec $asterisk -- $asterisk_args
+ fi
+ echo "."
+ ;;
+ logger-reload)
+ if [ -f $pidfile ]; then
+ $asterisk -rx "logger reload"
+ fi
+ ;;
+ *)
+ echo "Usage: /etc/init.d/asterisk {start|stop|force-stop|restart|force-restart|reload|logger-reload}"
+ exit 1
+esac
+
+exit 0
+