Skip to content

Commit

Permalink
yadm: don't require sudo
Browse files Browse the repository at this point in the history
  • Loading branch information
branchvincent committed Aug 20, 2024
1 parent 7cad527 commit 0d1fefe
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion bootstrap
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@ set -euo pipefail

# Prompt for and remember password
echo "Prompting for sudo password"
if [ -t 0 ]; then
if [ "${EUID:-$(id -u)}" -eq 0 ]; then
:
elif [ -t 0 ]; then
sudo --validate
else
sudo -n true
fi
while true; do
command -v sudo &>/dev/null || exit
sudo -n true
sleep 60
kill -0 "$$" || exit
Expand Down

0 comments on commit 0d1fefe

Please sign in to comment.