From 4c672ac5c4715de289aa862034fb9c0ca090fcf8 Mon Sep 17 00:00:00 2001 From: Alexander Lutay Date: Tue, 24 Jul 2018 16:15:22 +0200 Subject: [PATCH] TT#41051 Fix shellcheck warning for Red Hat init scripts * warning: cachefile appears unused. Verify it or export it. [SC2034] * warning: Double quote to prevent globbing and word splitting. [SC2086] * removed unnecessary space Change-Id: I71276ca08d1a5599bf1034403d2973ef78d8079e (cherry picked from commit bc9f09cdf53047d2f558e49e9fcf743e7c22e7e3) --- el/rtpengine-recording.init | 2 +- el/rtpengine.init | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/el/rtpengine-recording.init b/el/rtpengine-recording.init index 75597b800..1dc3299db 100644 --- a/el/rtpengine-recording.init +++ b/el/rtpengine-recording.init @@ -31,7 +31,7 @@ prog=rtpengine-recording runfile=/usr/sbin/${prog} pidfile=${PIDFILE-/var/run/rtpengine-recording.pid} lockfile=${LOCKFILE-/var/lock/subsys/rtpengine-recording} -cachefile=/var/lib/ngcp-rtpengine/$prog.cfg + RETVAL=0 OPTS="" diff --git a/el/rtpengine.init b/el/rtpengine.init index b5b8ca394..27f9459d5 100644 --- a/el/rtpengine.init +++ b/el/rtpengine.init @@ -48,19 +48,19 @@ build_opts() { fi else # configfile exists? - if [ ! -f $configfile ];then + if [ ! -f "$configfile" ];then echo "Error: $configfile not present" exit -1 fi # get table variable from config - table="$(grep -Ei '^table' $configfile|cut -d\ -f3)" - if [ -z $table ];then - table="$(grep -Ei '^table' $configfile|cut -d= -f3)" + table="$(grep -Ei '^table' "$configfile" | cut -d\ -f3)" + if [ -z "$table" ];then + table="$(grep -Ei '^table' "$configfile" | cut -d= -f3)" fi # error if directive is not presented in config - if [ -z $table ];then + if [ -z "$table" ];then echo "Error: directive table= is not present in $configfile" exit -1 fi @@ -79,9 +79,9 @@ build_opts() { fi # options - [[ "$FORK" == "no" ]] && OPTS+=" --foreground" - [[ "$LOG_STDERR" == "yes" ]] && OPTS+=" --log-stderr" - [[ "$FALLBACK" != "yes" ]] && OPTS+=" --no-fallback" + [[ "$FORK" == "no" ]] && OPTS+=" --foreground" + [[ "$LOG_STDERR" == "yes" ]] && OPTS+=" --log-stderr" + [[ "$FALLBACK" != "yes" ]] && OPTS+=" --no-fallback" [ -z "$CONFIG_FILE" ] || OPTS+=" --config-file=$CONFIG_FILE" [ -z "$CONFIG_SECTION" ] || OPTS+=" --config-section=$CONFIG_SECTION" [ -z "$ADDRESS" ] || OPTS+=" --interface=$ADDRESS"