Skip to content

Commit

Permalink
- check with aelparse syntax errors on ael-reload
Browse files Browse the repository at this point in the history
Changed files:
    asterisk.init -> 1.18
  • Loading branch information
glensc authored and cvs2git committed Jun 24, 2012
1 parent 95eafd9 commit 1b3bd1c
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions asterisk.init
Expand Up @@ -111,14 +111,32 @@ reload() {
fi
}

ael-reload() {
local res
res=$(aelparse -n -q | grep -F Error)
if [ "$res" ]; then
echo >&2 "$res"
RETVAL=1
return
fi

if [ ! -f /var/lock/subsys/asterisk ]; then
msg_not_running "Asterisk"
RETVAL=1
return
fi

/usr/sbin/asterisk -rx "ael reload"
}

RETVAL=0
# See how we were called.
case "$1" in
start)
start
start
;;
stop)
stop
stop
;;
restart)
stop
Expand All @@ -128,13 +146,13 @@ case "$1" in
condrestart 0
;;
reload|force-reload)
reload
reload
;;
dialplan-reload)
/usr/sbin/asterisk -rx "dialplan reload"
;;
ael-reload)
/usr/sbin/asterisk -rx "ael reload"
ael-reload
;;
logger-reload)
/usr/sbin/asterisk -rx "logger reload"
Expand Down

0 comments on commit 1b3bd1c

Please sign in to comment.