From 3a2f0750cb69d4d6af7d829cb999bc79f5fe794f Mon Sep 17 00:00:00 2001 From: Mark Spencer Date: Fri, 12 Mar 2004 20:20:36 +0000 Subject: Fix safe_asterisk script git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2410 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- contrib/scripts/safe_asterisk | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'contrib') diff --git a/contrib/scripts/safe_asterisk b/contrib/scripts/safe_asterisk index 326c6e0aa..ee2cc7717 100755 --- a/contrib/scripts/safe_asterisk +++ b/contrib/scripts/safe_asterisk @@ -64,13 +64,18 @@ run_asterisk() mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` & fi else - echo "Asterisk died with code $EXITSTATUS. Aborting." - if [ -f /tmp/core ]; then - mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` & + if [ "${EXITSTATUS}" = "0" ]; then + echo "Asterisk ended normally. Aborting." + exit 0 + else + echo "Asterisk died with code $EXITSTATUS." + if [ -f /tmp/core ]; then + mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` & + fi fi - exit 0 fi echo "Automatically restarting Asterisk." + sleep 1 done } -- cgit v1.2.3