From 4148f08bd398693a01b00d116353aeaa835a400b Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Fri, 26 Mar 2021 10:29:24 +0100 Subject: [PATCH] fix(cifs): shellcheck for modules.d/95cifs --- modules.d/95cifs/.shchkdir | 0 modules.d/95cifs/cifs-lib.sh | 3 +++ modules.d/95cifs/parse-cifsroot.sh | 7 +++++-- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 modules.d/95cifs/.shchkdir 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 -- 2.47.3