Allow passwordless sudo to be toggled from the toggle menu

This commit is contained in:
David Heinemeier Hansson
2026-04-29 14:58:34 +02:00
parent 12d8e001ab
commit c647edbc04
2 changed files with 5 additions and 2 deletions
+3 -1
View File
@@ -14,6 +14,8 @@ if [[ $1 && ! $1 =~ ^[0-9]+$ ]]; then
exit 1
fi
echo "Toggle passwordless sudo..."
# Safety: if the file exists but the timer doesn't (e.g. after reboot), clean up
if sudo test -f "$NOPASSWD_FILE" && ! systemctl is-active "${TIMER_NAME}.timer" &>/dev/null; then
sudo rm "$NOPASSWD_FILE"
@@ -33,7 +35,7 @@ if sudo test -f "$NOPASSWD_FILE"; then
fi
else
echo ""
echo "⚠️WARNING: This will allow ANY process running as your user to"
echo "⚠️ WARNING: This will allow ANY process running as your user to"
echo "execute ANY command as root WITHOUT a password for ${MINUTES} minutes."
echo ""
echo "This is useful for AI agents that need to run sudo commands,"