Fix the check proper
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user