diff options
author | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-14 01:13:32 +0000 |
---|---|---|
committer | russell <russell@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-08-14 01:13:32 +0000 |
commit | 88ba77b783cdba2f6778005358cd4c2dbc9214f1 (patch) | |
tree | 578bf5373c457bf31eafebbb1ac2ccd6ef98cffb /contrib | |
parent | 122c31952a9647bfef4df0ed8027aaa85075b54f (diff) |
add the ability to run an arbitrary command if asterisk crashes
(inspired by issue #7698, which was res_segfault by anthm)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@39636 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/scripts/safe_asterisk | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/scripts/safe_asterisk b/contrib/scripts/safe_asterisk index 3849e836e..48fd14cd7 100644 --- a/contrib/scripts/safe_asterisk +++ b/contrib/scripts/safe_asterisk @@ -5,6 +5,7 @@ CLIARGS="$*" # Grab any args passed to safe_asterisk TTY=9 # TTY (if you want one) for Asterisk to run on CONSOLE=yes # Whether or not you want a console #NOTIFY=ben@alkaloid.net # Who to notify about crashes +#EXEC=/path/to/somescript # Run this command if Asterisk crashes MACHINE=`hostname` # To specify which machine has crashed when getting the mail DUMPDROP=/tmp SLEEPSECS=4 @@ -131,6 +132,9 @@ run_asterisk() echo "Asterisk on $MACHINE exited on signal $EXITSIGNAL. Might want to take a peek." | \ mail -s "Asterisk Died" $NOTIFY fi + if [ "$EXEC" != "" ]; then + $EXEC + fi if [ -f /tmp/core ]; then mv /tmp/core ${DUMPDROP}/core.`hostname`-`date -Iseconds` & fi |