From: Harald Hoyer Date: Fri, 26 Mar 2021 09:29:24 +0000 (+0100) Subject: fix(cifs): shellcheck for modules.d/95cifs X-Git-Tag: 054~194 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4148f08bd398693a01b00d116353aeaa835a400b;p=thirdparty%2Fdracut.git fix(cifs): shellcheck for modules.d/95cifs --- diff --git a/modules.d/95cifs/.shchkdir b/modules.d/95cifs/.shchkdir new file mode 100644 index 000000000..e69de29bb diff --git a/modules.d/95cifs/cifs-lib.sh b/modules.d/95cifs/cifs-lib.sh index 304fb4dc1..b996b41b6 100755 --- a/modules.d/95cifs/cifs-lib.sh +++ b/modules.d/95cifs/cifs-lib.sh @@ -25,11 +25,14 @@ cifs_to_var() { cifsuser=$(getarg cifsuser) fi + # shellcheck disable=SC2034 path=${server#*/} + # shellcheck disable=SC2034 server=${server%/*} if [ ! "$cifsuser" -o ! "$cifspass" ]; then die "For CIFS support you need to specify a cifsuser and cifspass either in the cifsuser and cifspass commandline parameters or in the root= CIFS URL." fi + # shellcheck disable=SC2034 options="user=$cifsuser,pass=$cifspass,$(getarg rootflags=)" } diff --git a/modules.d/95cifs/parse-cifsroot.sh b/modules.d/95cifs/parse-cifsroot.sh index 5315e45c8..b88bef489 100755 --- a/modules.d/95cifs/parse-cifsroot.sh +++ b/modules.d/95cifs/parse-cifsroot.sh @@ -35,14 +35,17 @@ fi [ "${netroot%%:*}" = "cifs" ] || return # Check required arguments -cifs_to_var $netroot +cifs_to_var "$netroot" # If we don't have a server, we need dhcp if [ -z "$server" ]; then + # shellcheck disable=SC2034 DHCPORSERVER="1" fi # Done, all good! +# shellcheck disable=SC2034 rootok=1 -echo '[ -e $NEWROOT/proc ]' > $hookdir/initqueue/finished/cifsroot.sh +# shellcheck disable=SC2016 +echo '[ -e $NEWROOT/proc ]' > "$hookdir"/initqueue/finished/cifsroot.sh