diff options
author | mvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-30 16:57:49 +0000 |
---|---|---|
committer | mvanbaak <mvanbaak@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-05-30 16:57:49 +0000 |
commit | ed870e5775d2aa5a23fcbcaaa789fd5df4581e8d (patch) | |
tree | 8cc6602a15ebe43cf3a7968d886a8a9ef7071ec9 /contrib | |
parent | 2633eefb19843059b4c3e5b7ad272129abb4d59f (diff) |
Merged revisions 119302 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
................
r119302 | mvanbaak | 2008-05-30 18:47:24 +0200 (Fri, 30 May 2008) | 22 lines
Merged revisions 119301 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4
........
r119301 | mvanbaak | 2008-05-30 18:44:39 +0200 (Fri, 30 May 2008) | 14 lines
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: http://svn.digium.com/svn/asterisk/branches/1.6.0@119303 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'contrib')
-rwxr-xr-x | contrib/init.d/rc.debian.asterisk | 2 | ||||
-rwxr-xr-x | contrib/init.d/rc.gentoo.asterisk | 2 | ||||
-rwxr-xr-x | contrib/init.d/rc.mandrake.asterisk | 2 | ||||
-rwxr-xr-x | contrib/init.d/rc.redhat.asterisk | 2 | ||||
-rwxr-xr-x | contrib/init.d/rc.slackware.asterisk | 2 | ||||
-rwxr-xr-x | contrib/init.d/rc.suse.asterisk | 2 | ||||
-rw-r--r-- | contrib/scripts/safe_asterisk | 4 |
7 files changed, 8 insertions, 8 deletions
diff --git a/contrib/init.d/rc.debian.asterisk b/contrib/init.d/rc.debian.asterisk index 0d9eb6915..015f2db30 100755 --- a/contrib/init.d/rc.debian.asterisk +++ b/contrib/init.d/rc.debian.asterisk @@ -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 diff --git a/contrib/init.d/rc.gentoo.asterisk b/contrib/init.d/rc.gentoo.asterisk index efc87afc7..161bdd0ee 100755 --- a/contrib/init.d/rc.gentoo.asterisk +++ b/contrib/init.d/rc.gentoo.asterisk @@ -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 diff --git a/contrib/init.d/rc.mandrake.asterisk b/contrib/init.d/rc.mandrake.asterisk index 8d4f0b70d..e9da4a810 100755 --- a/contrib/init.d/rc.mandrake.asterisk +++ b/contrib/init.d/rc.mandrake.asterisk @@ -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 diff --git a/contrib/init.d/rc.redhat.asterisk b/contrib/init.d/rc.redhat.asterisk index de821fe8a..aeaa8f15e 100755 --- a/contrib/init.d/rc.redhat.asterisk +++ b/contrib/init.d/rc.redhat.asterisk @@ -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 diff --git a/contrib/init.d/rc.slackware.asterisk b/contrib/init.d/rc.slackware.asterisk index 0b2d3a7c5..c1db46f3c 100755 --- a/contrib/init.d/rc.slackware.asterisk +++ b/contrib/init.d/rc.slackware.asterisk @@ -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 diff --git a/contrib/init.d/rc.suse.asterisk b/contrib/init.d/rc.suse.asterisk index c8d94df1c..d7f1b82ac 100755 --- a/contrib/init.d/rc.suse.asterisk +++ b/contrib/init.d/rc.suse.asterisk @@ -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 diff --git a/contrib/scripts/safe_asterisk b/contrib/scripts/safe_asterisk index e73933ad4..c8841f3ed 100644 --- a/contrib/scripts/safe_asterisk +++ b/contrib/scripts/safe_asterisk @@ -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 @@ -41,7 +41,7 @@ function message() { # 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 message "Asterisk is already running. $0 will exit now." exit 1 fi |