Skip to content

Commit

Permalink
fix(lunmask): shellcheck regression
Browse files Browse the repository at this point in the history
`parse-lunmask.sh` is not a bash script
and dash doesn't understand `read -a`.

Revert to the initial code.

Fixes: #1271
  • Loading branch information
haraldh committed Mar 31, 2021
1 parent fd4b04d commit 56606b0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions modules.d/95lunmask/parse-lunmask.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,17 @@ EOF
}

for lunmask_arg in $(getargs rd.lunmask); do
IFS="," read -r -a _args <<< "$lunmask_arg"
if [ -d /sys/module/scsi_mod ]; then
printf "manual" > /sys/module/scsi_mod/parameters/scan
elif [ ! -f /etc/modprobe.d/95lunmask.conf ]; then
echo "options scsi_mod scan=manual" > /etc/modprobe.d/95lunmask.conf
fi
create_udev_rule "${_args[@]}"
(
local OLDIFS="$IFS"
local IFS=","
# shellcheck disable=SC2086
set $lunmask_arg
IFS="$OLDIFS"
if [ -d /sys/module/scsi_mod ]; then
printf "manual" > /sys/module/scsi_mod/parameters/scan
elif [ ! -f /etc/modprobe.d/95lunmask.conf ]; then
echo "options scsi_mod scan=manual" > /etc/modprobe.d/95lunmask.conf
fi
create_udev_rule "$1" "$2" "$3"
)
done

0 comments on commit 56606b0

Please sign in to comment.