rendered paste body#! /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 <miquels@cistron.nl>.
# Modified for Debian GNU/Linux
# by Ian Murdock <imurdock@gnu.ai.mit.edu>.
#
# 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
SAFE_DAEMON=/usr/sbin/safe_asterisk
NAME=asterisk
DESC="Asterisk PBX"
test -x $DAEMON || exit 0
set -e
case "$1" in
start)
echo -n "Starting $DESC: "
start-stop-daemon --start --exec $SAFE_DAEMON
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
$DAEMON -rx 'stop now' > /dev/null && echo -n "$NAME"
echo "."
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