From cb015ef1617ac6b6bd171ab08140b11cec9293a4 Mon Sep 17 00:00:00 2001 From: Darshaka Pathirana Date: Fri, 5 Mar 2021 16:33:44 +0100 Subject: [PATCH] usr_sbin/grml-iptstate: Fix a couple of shellcheck warnings - Ignore SC1091: Not following: /etc/grml/script-functions was not specified as input (see shellcheck -x). - Ignore SC1091: Not following: /etc/grml/lsb-functions was not specified as input (see shellcheck -x). - SC2162: read without -r will mangle backslashes. - SC2166: Prefer [ p ] || [ q ] as [ p -o q ] is not well defined. --- usr_sbin/grml-iptstate | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/usr_sbin/grml-iptstate b/usr_sbin/grml-iptstate index b9e9a2f..6dad6c2 100755 --- a/usr_sbin/grml-iptstate +++ b/usr_sbin/grml-iptstate @@ -6,7 +6,9 @@ # License: This file is licensed under the GPL v2. ################################################################################ +# shellcheck disable=SC1091 . /etc/grml/script-functions +# shellcheck disable=SC1091 . /etc/grml/lsb-functions check4progs iptstate || exit 1 @@ -18,8 +20,9 @@ else ewarn "Module ip_conntrack is not present. Can not start iptstate therefore." eindent einfon "Do you want to load it and invoke iptstate afterwards? [YES|no] " - read a - if [ "$a" = YES -o "$a" = yes -o "$a" = '' -o "$a" = y -o "$a" = Y ] ; then + read -r a + a=$(echo "$a" | tr '[:upper:]' '[:lower:]') + if [ "$a" = "yes" ] || [ "$a" = "y" ] || [ "$a" = "" ] ; then modprobe ip_conntrack ; RC=$? eend $RC [ "$RC" = 0 ] && exec iptstate -- 2.1.4