aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/init.d/rc.gentoo.asterisk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/init.d/rc.gentoo.asterisk')
-rwxr-xr-xcontrib/init.d/rc.gentoo.asterisk8
1 files changed, 8 insertions, 0 deletions
diff --git a/contrib/init.d/rc.gentoo.asterisk b/contrib/init.d/rc.gentoo.asterisk
index 3d963d6c0..efc87afc7 100755
--- a/contrib/init.d/rc.gentoo.asterisk
+++ b/contrib/init.d/rc.gentoo.asterisk
@@ -6,6 +6,14 @@ depend() {
}
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"
+ echo "Asterisk is already running. $0 will exit now."
+ exit 1
+ fi
+
ebegin "Starting Asterisk"
/usr/sbin/asterisk
eend $? "Failed to start Asterisk"