Fix the check proper
This commit is contained in:
@@ -6,8 +6,8 @@
|
|||||||
|
|
||||||
NOPASSWD_FILE="/etc/sudoers.d/99-omarchy-nopasswd-${USER}"
|
NOPASSWD_FILE="/etc/sudoers.d/99-omarchy-nopasswd-${USER}"
|
||||||
|
|
||||||
# sudo -n succeeds without a password prompt when passwordless sudo is active
|
# Check for the file directly — sudo -n can stay cached or be granted by other rules
|
||||||
if sudo -n true 2>/dev/null; then
|
if sudo test -f "$NOPASSWD_FILE"; then
|
||||||
sudo rm "$NOPASSWD_FILE"
|
sudo rm "$NOPASSWD_FILE"
|
||||||
echo "Passwordless sudo has been DISABLED. Sudo will require a password again."
|
echo "Passwordless sudo has been DISABLED. Sudo will require a password again."
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user