aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authormarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-12 20:20:36 +0000
committermarkster <markster@f38db490-d61c-443f-a65b-d21fe96a405b>2004-03-12 20:20:36 +0000
commit037b8a6ad8e6f07952f9aa2e15fbb08008f88825 (patch)
treeb73bcdb3de9424e1c53d6edb61e307a051b3761f /contrib
parent0cefe565e1df2b61fe07374376c25eb79374991a (diff)
Fix safe_asterisk script
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2410 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/scripts/safe_asterisk13
1 files changed, 9 insertions, 4 deletions
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
}