diff --git a/install.sh b/install.sh index 60e84a8..a278db2 100755 --- a/install.sh +++ b/install.sh @@ -27,6 +27,11 @@ set -e # Ask for sudo password upfront so subsequent sudo calls don't prompt mid-install sudo -v +# Grant passwordless sudo for the duration of the install, revoke on exit +echo "$USER ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/99-hampack-install > /dev/null +sudo chmod 440 /etc/sudoers.d/99-hampack-install +trap "sudo rm -f /etc/sudoers.d/99-hampack-install" EXIT + # Ensure git is available before attempting to clone anything if ! command -v git &> /dev/null; then echo "Installing git..."