mirror of
https://github.com/rocky-linux/rocky-tools.git
synced 2024-11-22 13:11:26 +00:00
Fix shellcheck issues
Fix issues found by shellcheck.
This commit is contained in:
parent
606390af59
commit
1529747183
@ -231,6 +231,7 @@ bin_check() {
|
|||||||
for pkg in "${!pkgs[@]}"; do
|
for pkg in "${!pkgs[@]}"; do
|
||||||
ver=${pkgs[$pkg]}
|
ver=${pkgs[$pkg]}
|
||||||
if ! pkg_ver "$pkg" "$ver"; then
|
if ! pkg_ver "$pkg" "$ver"; then
|
||||||
|
# shellcheck disable=SC2140
|
||||||
exit_message \
|
exit_message \
|
||||||
"$pkg >= $ver is required for this script. Please run "\
|
"$pkg >= $ver is required for this script. Please run "\
|
||||||
"\"dnf install $pkg; dnf update\" first."
|
"\"dnf install $pkg; dnf update\" first."
|
||||||
@ -381,7 +382,7 @@ collect_system_info () {
|
|||||||
kname=$(lsblk -dno kname "$efi_mount")
|
kname=$(lsblk -dno kname "$efi_mount")
|
||||||
cd "/sys/block/$kname/slaves" || exit_message \
|
cd "/sys/block/$kname/slaves" || exit_message \
|
||||||
"Unable to gather EFI data: Can't cd to /sys/block/$kname/slaves."
|
"Unable to gather EFI data: Can't cd to /sys/block/$kname/slaves."
|
||||||
if ! (shopt -s failglob; : *) 2>/dev/null; then
|
if ! (shopt -s failglob; : ./*) 2>/dev/null; then
|
||||||
exit_message \
|
exit_message \
|
||||||
"Unable to gather EFI data: No slaves found in /sys/block/$kname/slaves."
|
"Unable to gather EFI data: No slaves found in /sys/block/$kname/slaves."
|
||||||
fi
|
fi
|
||||||
@ -577,7 +578,7 @@ $'because continuing with the migration could cause further damage to system.'
|
|||||||
repl=${module_glob_map[$gl]}
|
repl=${module_glob_map[$gl]}
|
||||||
mod=${mod/$gl/$repl}
|
mod=${mod/$gl/$repl}
|
||||||
done
|
done
|
||||||
if [[ $mod != ${enabled_modules[$i]} ]]; then
|
if [[ $mod != "${enabled_modules[$i]}" ]]; then
|
||||||
disable_modules+=(${enabled_modules[$i]})
|
disable_modules+=(${enabled_modules[$i]})
|
||||||
enabled_modules[$i]=$mod
|
enabled_modules[$i]=$mod
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user