From cc01aee4e4b2e2c2b1a2c959e8ce5fc921025838 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sat, 23 Mar 2013 04:02:58 -0400 Subject: [PATCH] Sudo keep-alive --- bin/update | 5 ++++- deploy | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/bin/update b/bin/update index d75ef1e9..de5fbc2f 100755 --- a/bin/update +++ b/bin/update @@ -1,8 +1,11 @@ #!/bin/zsh -# Ask for the password up front +# 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 & + cd ~/.dotfiles echo "Updating ALL the things!" diff --git a/deploy b/deploy index b93ea7c3..5d040004 100755 --- a/deploy +++ b/deploy @@ -2,6 +2,12 @@ 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 ###### # If the install folder doesn't exist, you bash < <(curl ...)'d this script! if [ ! -d "$INSTALL_DIR" ]; then