mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-25 22:18:07 +00:00
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/branches/1.4@115285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -119,6 +119,14 @@ run_asterisk()
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
# Check if Asterisk is already running. If it is, then bug out, because
|
||||
# starting Asterisk when Asterisk is already running is very bad.
|
||||
VERSION=`${ASTSBINDIR}/asterisk -rx 'core show version'`
|
||||
if [ "${VERSION:0:8}" = "Asterisk" ]; then # otherwise "Unable t"
|
||||
echo "Asterisk is already running. $0 will exit now."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gprintf "Starting asterisk: "
|
||||
run_asterisk >/dev/null 2>&1 &
|
||||
sleep 2 # Give it time to die
|
||||
|
||||
Reference in New Issue
Block a user