aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/scripts
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-05 03:25:35 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2008-05-05 03:25:35 +0000
commitffb620f33d99660082aa32203c227606955b6c16 (patch)
tree2beb5b49356fe21b1a4ded5f0f6b9ca311287d5a /contrib/scripts
parenta0331e1cf47381b2841361a5c57020012b874816 (diff)
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/trunk@115286 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.