do not start asterisk until the router receives a default route

This commit is contained in:
Sukru Senli 2016-03-04 16:27:11 +01:00
parent 0d3466445c
commit 8cd62ff81f

View file

@ -9,6 +9,12 @@ PROG=/usr/sbin/asterisk
DEFAULT=/etc/default/asterisk
init_asterisk() {
# do not start asterisk until the
# router receives a default route
while ! ip r | grep -q default; do
sleep 1
done
[ -f $DEFAULT ] && . $DEFAULT
[ -d /var/run/asterisk ] || mkdir -p /var/run/asterisk
[ -d /var/log/asterisk ] || mkdir -p /var/log/asterisk