Browse Source

fix(cifs): shellcheck for modules.d/95cifs

master
Harald Hoyer 3 years ago committed by Harald Hoyer
parent
commit
4148f08bd3
  1. 0
      modules.d/95cifs/.shchkdir
  2. 3
      modules.d/95cifs/cifs-lib.sh
  3. 7
      modules.d/95cifs/parse-cifsroot.sh

0
modules.d/95cifs/.shchkdir

3
modules.d/95cifs/cifs-lib.sh

@ -25,11 +25,14 @@ cifs_to_var() { @@ -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=)"
}

7
modules.d/95cifs/parse-cifsroot.sh

@ -35,14 +35,17 @@ fi @@ -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

Loading…
Cancel
Save