summaryrefslogtreecommitdiff
path: root/contrib/scripts/safe_asterisk
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2008-05-05 03:25:35 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2008-05-05 03:25:35 +0000
commite01ada1ca709510b056cde266d4e2856ae3a8a08 (patch)
tree2beb5b49356fe21b1a4ded5f0f6b9ca311287d5a /contrib/scripts/safe_asterisk
parentb8dae12c06cc1f16fcac221f4a6ade0a25d87710 (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: https://origsvn.digium.com/svn/asterisk/trunk@115286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'contrib/scripts/safe_asterisk')
-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.