All pastes #298 Raw Edit

PooseMenus

public text v1 · immutable
#298 ·published 2004-07-18 02:48 UTC
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
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 $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