dracut-module-setup.sh: make iscsi check fail early if cd failed

As suggested by:
https://github.com/koalaman/shellcheck/wiki/SC2164

Signed-off-by: Kairui Song <kasong@redhat.com>
Acked-by: Philipp Rudo <prudo@redhat.com>
This commit is contained in:
Kairui Song 2021-08-04 16:29:55 +08:00
parent 3b2fa982bb
commit 67e559a6b9

View File

@ -855,7 +855,7 @@ kdump_check_iscsi_targets () {
_dev=$1
[[ -L /sys/dev/block/$_dev ]] || return
cd "$(readlink -f /sys/dev/block/$_dev)"
cd "$(readlink -f "/sys/dev/block/$_dev")" || return 1
until [[ -d sys || -d iscsi_session ]]; do
cd ..
done