Simpler command structure
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Toggle passwordless sudo for the current user.
|
# Toggle passwordless sudo for the current user.
|
||||||
# Usage: omarchy-sudo-passwordless-toggle [MINUTES]
|
# Usage: omarchy-sudo-passwordless [MINUTES]
|
||||||
# First run: enables passwordless sudo for 15 minutes (after confirmation).
|
# First run: enables passwordless sudo for 15 minutes (after confirmation).
|
||||||
# Second run: disables it early.
|
# Second run: disables it early.
|
||||||
|
|
||||||
@@ -10,7 +10,7 @@ TIMER_NAME="omarchy-nopasswd-expire-${USER}"
|
|||||||
|
|
||||||
MINUTES=${1:-15}
|
MINUTES=${1:-15}
|
||||||
if [[ $1 && ! $1 =~ ^[0-9]+$ ]]; then
|
if [[ $1 && ! $1 =~ ^[0-9]+$ ]]; then
|
||||||
echo "Usage: omarchy-sudo-passwordless-toggle [MINUTES]" >&2
|
echo "Usage: omarchy-sudo-passwordless [MINUTES]" >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -52,7 +52,7 @@ else
|
|||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
echo "Passwordless sudo has been ENABLED. It will automatically disable in ${MINUTES} minutes."
|
echo "Passwordless sudo has been ENABLED. It will automatically disable in ${MINUTES} minutes."
|
||||||
echo "Note: if you restart before then, run omarchy-sudo-passwordless-toggle again to disable it."
|
echo "Note: if you restart before then, run omarchy-sudo-passwordless again to disable it."
|
||||||
else
|
else
|
||||||
echo "Aborted. No changes made."
|
echo "Aborted. No changes made."
|
||||||
fi
|
fi
|
||||||
Reference in New Issue
Block a user