Fix the check proper

This commit is contained in:
David Heinemeier Hansson
2026-03-15 16:10:59 +01:00
parent d37d93caee
commit 2bd0e23a5f
+2 -2
View File
@@ -6,8 +6,8 @@
NOPASSWD_FILE="/etc/sudoers.d/99-omarchy-nopasswd-${USER}"
# sudo -n succeeds without a password prompt when passwordless sudo is active
if sudo -n true 2>/dev/null; then
# Check for the file directly — sudo -n can stay cached or be granted by other rules
if sudo test -f "$NOPASSWD_FILE"; then
sudo rm "$NOPASSWD_FILE"
echo "Passwordless sudo has been DISABLED. Sudo will require a password again."
else