From 2bd0e23a5fdb871b0398a7cdf96ae41c9517f690 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 15 Mar 2026 16:10:59 +0100 Subject: [PATCH] Fix the check proper --- bin/omarchy-sudo-passwordless-toggle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/omarchy-sudo-passwordless-toggle b/bin/omarchy-sudo-passwordless-toggle index 9665ee41..9278a0da 100755 --- a/bin/omarchy-sudo-passwordless-toggle +++ b/bin/omarchy-sudo-passwordless-toggle @@ -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