From 30b0ecaf2330bd79e909a4c0b0c283dd9e517c7a Mon Sep 17 00:00:00 2001 From: Oyvind Repvik Date: Sun, 18 Mar 2007 15:26:34 +0000 Subject: openpbx/spandsp: Add packages openpbx and spandsp, thanks to hillctl --- packages/openpbx/files/init | 75 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 packages/openpbx/files/init (limited to 'packages/openpbx/files/init') diff --git a/packages/openpbx/files/init b/packages/openpbx/files/init new file mode 100644 index 0000000000..0ce88c4626 --- /dev/null +++ b/packages/openpbx/files/init @@ -0,0 +1,75 @@ +#! /bin/sh +# +# This is an init script for openembedded +# Copy it to /etc/init.d/openpbx and type +# > update-rc.d openpbx defaults 60 +# +openpbx=/usr/sbin/openpbx +pidfile=/var/run/openpbx.org/openpbx.pid + +test -x "$openpbx" || exit 0 + +case "$1" in + start) + echo -n "Starting OpenPBX" + start-stop-daemon --start --quiet --exec $openpbx -- -npq + echo "." + ;; + stop) + echo -n "Stopping OpenPBX" + $openpbx -rx "stop gracefully" + sleep 4 + if [ -f $pidfile ]; then + start-stop-daemon --stop --quiet --pidfile $pidfile + fi + echo "." + ;; + force-stop) + echo -n "Stopping OpenPBX" + $openpbx -rx "stop now" + sleep 2 + if [ -f $pidfile ]; then + start-stop-daemon --stop --quiet --pidfile $pidfile + fi + echo "." + ;; + restart) + echo -n "Restarting OpenPBX" + if [ -f $pidfile ]; then + $openpbx -rx "restart gracefully" + sleep 2 + else + start-stop-daemon --start --quiet --exec $openpbx -- -npq + fi + ;; + force-restart) + echo -n "Forcibly Restarting OpenPBX" + if [ -f $pidfile ]; then + $openpbx -rx "restart now" + sleep 2 + else + start-stop-daemon --start --quiet --exec $openpbx -- -npq + fi + ;; + reload) + echo -n "Reloading OpenPBX Configuration" + if [ -f $pidfile ]; then + $openpbx -rx "reload" + else + start-stop-daemon --start --quiet --exec $openpbx -- -npq + fi + echo "." + ;; + logger-reload) +# echo -n "Restating OpenPBX Logger" + if [ -f $pidfile ]; then + $openpbx -rx "logger reload" + fi +# echo "." + ;; + *) + echo "Usage: /etc/init.d/openpbx {start|stop|force-stop|restart|force-restart|reload|logger-reload}" + exit 1 +esac + +exit 0 -- cgit v1.2.3