Skip to content

Instantly share code, notes, and snippets.

@jsamuel1
Created January 27, 2021 23:25
Show Gist options
  • Save jsamuel1/67fd4c5b9e463cb74f5a0832341abf0e to your computer and use it in GitHub Desktop.
Save jsamuel1/67fd4c5b9e463cb74f5a0832341abf0e to your computer and use it in GitHub Desktop.
sudo Keep-alive for scripts: update existing `sudo` time stamp until script has finished
# Keep-alive: update existing `sudo` time stamp until script has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment