summaryrefslogtreecommitdiff
path: root/contrib/init.d/rc.suse.asterisk
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/init.d/rc.suse.asterisk')
-rwxr-xr-xcontrib/init.d/rc.suse.asterisk39
1 files changed, 38 insertions, 1 deletions
diff --git a/contrib/init.d/rc.suse.asterisk b/contrib/init.d/rc.suse.asterisk
index 54b67207a..e4976bb61 100755
--- a/contrib/init.d/rc.suse.asterisk
+++ b/contrib/init.d/rc.suse.asterisk
@@ -59,6 +59,15 @@ SAFE_ASTERISK=/usr/sbin/safe_asterisk
#AST_USER="asterisk"
#AST_GROUP="asterisk"
+# Allow configuration overrides in /etc/sysconfig/asterisk
+CONFIG0=`readlink $0`
+if [ "$CONFIG0" = "" ]; then
+ CONFIGFILE=/etc/sysconfig/`basename $0`
+else
+ CONFIGFILE=/etc/sysconfig/`basename $CONFIG0`
+fi
+[ -r $CONFIGFILE ] && . $CONFIGFILE
+
RETVAL=0
start() {
@@ -82,7 +91,35 @@ start() {
if [ $AST_GROUP ] ; then
ASTARGS="`echo $ASTARGS` -G $AST_GROUP"
fi
- $DAEMON $ASTARGS
+ 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 [ "$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
+ if [ "x$COLOR" = "xyes" ]; then
+ export TERM=linux
+ sh -c "$DAEMON $ASTARGS -c" >/dev/null </dev/null 2>&1 &
+ else
+ $DAEMON $ASTARGS
+ fi
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/asterisk
echo