summaryrefslogtreecommitdiff
path: root/contrib/init.d/rc.debian.asterisk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/init.d/rc.debian.asterisk')
-rwxr-xr-xcontrib/init.d/rc.debian.asterisk47
1 files changed, 32 insertions, 15 deletions
diff --git a/contrib/init.d/rc.debian.asterisk b/contrib/init.d/rc.debian.asterisk
index 045a8ceef..22f6f974e 100755
--- a/contrib/init.d/rc.debian.asterisk
+++ b/contrib/init.d/rc.debian.asterisk
@@ -38,21 +38,6 @@ TRUE=/bin/true
# Description: the Asterisk Open Source PBX
### END INIT INFO
-# Uncomment this ONLY if you know what you are doing.
-# export LD_ASSUME_KERNEL=2.4.1
-
-# Uncomment the following and set them to the user/groups that you
-# want to run Asterisk as. NOTE: this requires substantial work to
-# be sure that Asterisk's environment has permission to write the
-# files required for its operation, including logs, its comm
-# socket, the asterisk database, etc.
-#AST_USER="asterisk"
-#AST_GROUP="asterisk"
-
-# If you DON'T want Asterisk to start up with terminal colors, comment
-# this out.
-COLOR=yes
-
set -e
if ! [ -x $DAEMON ] ; then
@@ -68,6 +53,15 @@ fi
# Use the LSB standar functions for services management
. /lib/lsb/init-functions
+# Allow configuration overrides in /etc/default/asterisk
+CONFIG0=`readlink $0`
+if [ "$CONFIG0" = "" ]; then
+ CONFIGFILE=/etc/default/`basename $0`
+else
+ CONFIGFILE=/etc/default/`basename $CONFIG0`
+fi
+[ -r $CONFIGFILE ] && . $CONFIGFILE
+
case "$1" in
start)
# Check if Asterisk is already running. If it is, then bug out, because
@@ -91,6 +85,29 @@ case "$1" in
ASTARGS="$ASTARGS -G $AST_GROUP"
chgrp $AST_GROUP $ASTVARRUNDIR
fi
+ if [ $ALTCONF ]; then
+ ASTARGS="$ASTARGS -C \"$ALTCONF\""
+ fi
+ if [ "x$COREDUMP" = "xyes" ]; then
+ ASTARGS="$ASTARGS -g"
+ fi
+ if [ "0$MAXLOAD" -gt "0" ]; then
+ ASTARGS="$ASTARGS -L $MAXLOAD"
+ fi
+ if [ "0$MAXCALLS" -gt "0" ]; then
+ ASTARGS="$ASTARGS -M $MAXCALLS"
+ fi
+ if [ "0$VERBOSITY" -gt "0" ]; then
+ for i in `seq 1 $VERBOSITY`; do
+ ASTARGS="$ASTARGS -v"
+ done
+ fi
+ if [ "x$INTERNALTIMING" = "xyes" ]; then
+ ASTARGS="$ASTARGS -I"
+ fi
+ if [ "x$TEMPRECORDINGLOCATION" = "xyes" -o "x$TMPRECORDINGLOCATION" = "xyes" ]; then
+ ASTARGS="$ASTARGS -t"
+ fi
# "start-stop-daemon --oknodo" returns 0 even if Asterisk was already running (as LSB expects):
if test "x$COLOR" = "xyes" ; then
export TERM=linux