From 3b927dc8ed07ca0e97fc8b09cf41359effd1a0ba Mon Sep 17 00:00:00 2001 From: qoijjj <129108030+qoijjj@users.noreply.github.com> Date: Sat, 10 Aug 2024 03:56:35 -0700 Subject: [PATCH] fix: check only the first string token when searching lsattr --- files/system/usr/share/ublue-os/just/60-custom.just | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/system/usr/share/ublue-os/just/60-custom.just b/files/system/usr/share/ublue-os/just/60-custom.just index ddfa827..ffb24fe 100644 --- a/files/system/usr/share/ublue-os/just/60-custom.just +++ b/files/system/usr/share/ublue-os/just/60-custom.just @@ -274,7 +274,7 @@ toggle-bash-environment-lockdown: echo "Please type in \"YES I UNDERSTAND\" and press enter" read ACCEPT if [ "$ACCEPT" == "YES I UNDERSTAND" ]; then - if lsattr "${BASH_ENV_FILES[0]}" 2>/dev/null | grep -q 'i'; then + if lsattr "${BASH_ENV_FILES[0]}" 2>/dev/null | awk '{print $1}' | grep -q 'i'; then echo "Bash environment '(${BASH_ENV_FILES[@]})' is locked down. Unlocking it." for file in "${BASH_ENV_FILES[@]}"; do pkexec chattr -i "$file"