-
-
Save danijeljw/f1b7edd1ed5a00dc70dd79e07244e682 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Kick off with sudo request | |
sudo -v | |
# Keep-alive: update existing sudo time stamp if set, otherwise do nothing. | |
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null & | |
# Kill sudo when done, no password required: | |
sudo -k |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment