Starten von Asterisk
Buch - Scripte

 

/etc/init.d/asterisk

#!/bin/sh
#
#
# Einfaches INIT Script zum starten und beenden
# der Asterisk PBX

ASTERISK=/usr/sbin/asterisk

case "$1" in
start)
echo "Starte ASTERISK"
$ASTERISK
sleep 2
;;
reload)
echo "Lade Asterisk Konfiguration neu"
$ASTERISK -rx 'reload'
sleep 2
;;
restart)
echo "Beende Asterisk"
$ASTERISK -rx "stop now"
sleep 2
echo "Starte Asterisk"
$ASTERISK
sleep 2
;;
stop)
echo "Beende ASTERISK"
$ASTERISK -rx 'stop now'
sleep 2
;;
*)
echo "Syntax: asterisk {start|stop|reload|restart|}"
exit 1
;;
esac
exit 0