Sudo keep-alive

This commit is contained in:
Henrik Lissner 2013-03-23 04:02:58 -04:00
parent 98ef18ce7a
commit cc01aee4e4
2 changed files with 10 additions and 1 deletions

View file

@ -1,8 +1,11 @@
#!/bin/zsh #!/bin/zsh
# Ask for the password up front # Ask for the administrator password upfront
sudo -v sudo -v
# Keep-alive: update existing `sudo` time stamp until script is done
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
cd ~/.dotfiles cd ~/.dotfiles
echo "Updating ALL the things!" echo "Updating ALL the things!"

6
deploy
View file

@ -2,6 +2,12 @@
INSTALL_DIR="$HOME/.dotfiles" INSTALL_DIR="$HOME/.dotfiles"
# Ask for the administrator password upfront
sudo -v
# Keep-alive: update existing `sudo` time stamp until script is done
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
##### GIT & DOTFILES ###### ##### GIT & DOTFILES ######
# If the install folder doesn't exist, you bash < <(curl ...)'d this script! # If the install folder doesn't exist, you bash < <(curl ...)'d this script!
if [ ! -d "$INSTALL_DIR" ]; then if [ ! -d "$INSTALL_DIR" ]; then