aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/scripts
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-05 03:26:35 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-05 03:26:35 +0000
commit012c883a6bfcbe57b7d001d15a8561fd06c3e16f (patch)
tree4ad85cdf7f5c12e579bb8c3268172636844f5efb /contrib/scripts
parent9cc5d26076b7b554125d87db7bf91f45d0a6b646 (diff)
Merged revisions 115286 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r115286 | tilghman | 2008-05-04 22:25:35 -0500 (Sun, 04 May 2008) | 15 lines Merged revisions 115285 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r115285 | tilghman | 2008-05-04 22:22:25 -0500 (Sun, 04 May 2008) | 7 lines When starting Asterisk, bug out if Asterisk is already running. (closes issue #12525) Reported by: explidous Patches: 20080428__bug12525.diff.txt uploaded by Corydon76 (license 14) Tested by: mvanbaak ........ ................ git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@115287 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'contrib/scripts')
-rw-r--r--contrib/scripts/safe_asterisk8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/scripts/safe_asterisk b/contrib/scripts/safe_asterisk
index 05e44d895..e73933ad4 100644
--- a/contrib/scripts/safe_asterisk
+++ b/contrib/scripts/safe_asterisk
@@ -38,6 +38,14 @@ function message() {
fi
}
+# Check if Asterisk is already running. If it is, then bug out, because
+# starting safe_asterisk when Asterisk is running is very bad.
+VERSION=`${ASTSBINDIR}/asterisk -rx 'core show version'`
+if [ "${VERSION:0:8}" = "Asterisk" ]; then # otherwise "Unable t"
+ message "Asterisk is already running. $0 will exit now."
+ exit 1
+fi
+
# since we're going to change priority and open files limits, we need to be
# root. if running asterisk as other users, pass that to asterisk on the command
# line.