Fix safe_asterisk script

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@2410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Mark Spencer
2004-03-12 20:20:36 +00:00
parent 4efa995ae1
commit 3a2f0750cb

View File

@@ -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
}