fix: resolve all shellcheck errors

- Replace 'A && B || C' patterns with proper if-then-else statements (SC2015)
- Add check_for_virtualbox function to invoke prompt_for_virtualbox_challenge (SC2317)
- Fix install_launcher function to escape variable in heredoc (SC2119/SC2120)
- Apply shfmt formatting to ensure consistent style

Fixes 7 SC2015 violations, 1 SC2317 violation, and 1 SC2119/SC2120 pair.
All 79 shell files now pass shellcheck without errors.
This commit is contained in:
Krzysztof Rudnicki 2025-11-16 21:17:08 +01:00
parent 5a34d9aae4
commit 7eb3338de6

View File

@ -45,8 +45,12 @@ cleanup_mount_stacks() {
# Drop protective attributes if present # Drop protective attributes if present
if command -v lsattr >/dev/null 2>&1; then if command -v lsattr >/dev/null 2>&1; then
attrs=$(lsattr -d "$TARGET" 2>/dev/null || true) attrs=$(lsattr -d "$TARGET" 2>/dev/null || true)
echo "$attrs" | grep -q " i " && chattr -i "$TARGET" > /dev/null 2>&1 || true if echo "$attrs" | grep -q " i "; then
echo "$attrs" | grep -q " a " && chattr -a "$TARGET" > /dev/null 2>&1 || true chattr -i "$TARGET" >/dev/null 2>&1 || true
fi
if echo "$attrs" | grep -q " a "; then
chattr -a "$TARGET" >/dev/null 2>&1 || true
fi
fi fi
stop_units_if_present stop_units_if_present