mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-04 11:58:52 +00:00
dont use a bashism way to check the $VERSION variable.
The rc/init.d scripts, and safe_asterisk work on normal sh now again. Tested on: OpenBSD 4.2 (me) Debian etch (me) Ubuntu Hardy (me and loloski) FC9 (loloski) (closes issue #12687) Reported by: loloski Patches: 20080529-12687-safe_asterisk-fixversion.diff.txt uploaded by mvanbaak (license 7) Tested by: loloski, mvanbaak git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@119301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -55,7 +55,7 @@ case "$1" in
|
||||
# Check if Asterisk is already running. If it is, then bug out, because
|
||||
# starting up Asterisk when Asterisk is already running is very bad.
|
||||
VERSION=`${DAEMON} -rx 'core show version' || ${TRUE}`
|
||||
if [ "${VERSION:0:8}" = "Asterisk" ]; then # otherwise "Unable t"
|
||||
if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
|
||||
echo "Asterisk is already running. $0 will exit now."
|
||||
exit 1
|
||||
fi
|
||||
|
@@ -9,7 +9,7 @@ start() {
|
||||
# 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"
|
||||
if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
|
||||
echo "Asterisk is already running. $0 will exit now."
|
||||
exit 1
|
||||
fi
|
||||
|
@@ -122,7 +122,7 @@ case "$1" in
|
||||
# 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"
|
||||
if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
|
||||
echo "Asterisk is already running. $0 will exit now."
|
||||
exit 1
|
||||
fi
|
||||
|
@@ -71,7 +71,7 @@ start() {
|
||||
# Check if Asterisk is already running. If it is, then bug out, because
|
||||
# starting safe_asterisk when Asterisk is running is very bad.
|
||||
VERSION=`${AST_SBIN}/asterisk -rx 'core show version'`
|
||||
if [ "${VERSION:0:8}" = "Asterisk" ]; then # otherwise "Unable t"
|
||||
if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
|
||||
echo "Asterisk is already running."
|
||||
exit 1
|
||||
fi
|
||||
|
@@ -13,7 +13,7 @@ asterisk_start() {
|
||||
# Check if Asterisk is already running. If it is, then bug out, because
|
||||
# starting safe_asterisk when Asterisk is running is very bad.
|
||||
VERSION=`/usr/sbin/asterisk -rx 'core show version'`
|
||||
if [ "${VERSION:0:8}" = "Asterisk" ]; then # otherwise "Unable t"
|
||||
if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
|
||||
echo "Asterisk is already running. $0 will exit now."
|
||||
exit 1
|
||||
fi
|
||||
|
@@ -67,7 +67,7 @@ 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=`/usr/sbin/asterisk -rx 'core show version'`
|
||||
if [ "${VERSION:0:8}" = "Asterisk" ]; then # otherwise "Unable t"
|
||||
if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
|
||||
echo "Asterisk is already running. $0 will exit now."
|
||||
exit 1
|
||||
fi
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/bin/sh
|
||||
# vim:textwidth=80:tabstop=4:shiftwidth=4:smartindent:autoindent
|
||||
|
||||
CLIARGS="$*" # Grab any args passed to safe_asterisk
|
||||
@@ -29,7 +29,7 @@ PRIORITY=0
|
||||
# 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"
|
||||
if [ "`echo $VERSION | cut -c 1-8`" = "Asterisk" ]; then
|
||||
echo "Asterisk is already running. $0 will exit now."
|
||||
exit 1
|
||||
fi
|
||||
|
Reference in New Issue
Block a user