modernize debian init.d script to eliminate warnings

Change-Id: I06a01c82a3f7547d939e5d41de4535f91a423f90
changes/48/9948/6
Richard Fuchs 9 years ago
parent a2391f9490
commit 9e38b8fa94

@ -16,22 +16,17 @@ NAME=ngcp-rtpengine-daemon
DESC="RTP/media proxy"
TABLE=0
case $(dirname $0) in
/*) FULLPATH=$(dirname $0);;
*) FULLPATH=$(pwd)/$(dirname $0);;
esac
DAEMON=`which rtpengine`
DAEMON=$(which rtpengine)
DEFAULTS=/etc/default/${NAME}
test -f $DAEMON || exit 0
test -f "$DAEMON" || exit 0
# Load startup options if available
if [ -f $DEFAULTS ]; then
. $DEFAULTS || true
if [ -f "$DEFAULTS" ]; then
. "$DEFAULTS" || true
fi
if [ "$RUN_RTPENGINE" != "yes" -a "$RUN_MEDIAPROXY" != "yes" ]; then
if [ "$RUN_RTPENGINE" != "yes" ]; then
echo "rtpengine not yet configured. Edit $DEFAULTS first."
exit 0
fi
@ -137,7 +132,7 @@ case "$1" in
;;
esac
fi
echo -n "Starting $DESC: $NAME"
log_daemon_msg "Starting $DESC: $NAME"
if [ "$TABLE" -ge 0 ] && [ "$VIRT" != "yes" ]; then
set +e
modprobe xt_RTPENGINE
@ -175,14 +170,14 @@ case "$1" in
fi
set -e
fi
start-stop-daemon --start --quiet --pidfile $PIDFILE \
--exec $DAEMON -- $OPTIONS || echo -n " already running"
start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
--exec "$DAEMON" -- $OPTIONS || log_progress_msg " already running"
log_end_msg $?
;;
stop)
echo -n "Stopping $DESC: $NAME"
log_daemon_msg "Stopping $DESC: $NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE \
--exec $DAEMON
--exec "$DAEMON"
if [ "$?" -ne 0 ]; then
return $?
fi
@ -214,9 +209,9 @@ case "$1" in
;;
restart|force-reload)
echo -n "Restarting $DESC: $NAME"
log_daemon_msg "Restarting $DESC: $NAME"
start-stop-daemon --oknodo --stop --quiet --pidfile \
$PIDFILE --exec $DAEMON
"$PIDFILE" --exec $DAEMON
if [ "$?" -ne 0 ]; then
return $?
fi
@ -226,10 +221,10 @@ case "$1" in
status=$?
case "${status}" in
0|3)
echo "Active node or transition."
log_progress_msg "Active node or transition."
;;
*)
echo "Ignored start action in inactive node ($status)"
log_progress_msg "Ignored start action in inactive node ($status)"
exit 0
;;
esac
@ -273,7 +268,7 @@ case "$1" in
set -e
fi
start-stop-daemon --start --quiet --pidfile \
$PIDFILE --exec $DAEMON -- $OPTIONS
"$PIDFILE" --exec "$DAEMON" -- $OPTIONS
log_end_msg $?
;;
status)

Loading…
Cancel
Save