Allow passwordless sudo to be toggled from the toggle menu
This commit is contained in:
@@ -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,"
|
||||
|
||||
Reference in New Issue
Block a user