#! /bin/sh # # asterisk start the asterisk PBX # # Based on: # # skeleton example file to build /etc/init.d/ scripts. # This file should be used to construct scripts for /etc/init.d. # # Written by Miquel van Smoorenburg . # Modified for Debian GNU/Linux # by Ian Murdock . # # Version: @(#)skeleton 1.9 26-Feb-2001 miquels@cistron.nl # PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin DAEMON=/usr/sbin/asterisk NAME=root DESC="Asterisk PBX" QOZAP=/root/bri-stuff.0.1.0-RC4a/qozap test -x $DAEMON || exit 0 set -e case "$1" in start) cd $QOZAP make load cd - echo -n "Starting $DESC: " start-stop-daemon --start --chuid $NAME \ --exec $DAEMON sleep 5 <<<<<<<<<<<<<<<< sleep $DAEMON -rx "load chan_zap.so" echo "$NAME." ;; stop) echo -n "Stopping $DESC: " $DAEMON -rx 'stop now' > /dev/null && echo -n "$NAME" echo "." cd $QOZAP make unload cd - exit 0 ;; reload) echo "Reloading $DESC configuration files." $DAEMON -rx reload ;; restart|force-reload) $DAEMON -rx 'restart gracefully' > /dev/null && echo -n "$NAME" ;; *) N=/etc/init.d/$NAME # echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 echo "Usage: $N {start|stop|restart|force-reload}" >&2 exit 1 ;; esac exit 0