diff --git a/arch-setup/install.sh b/arch-setup/install.sh index e9c3c607..570b471c 100755 --- a/arch-setup/install.sh +++ b/arch-setup/install.sh @@ -4,6 +4,22 @@ # NOTE ignore errors from missing "||". Try getting the line below to work #set -euo pipefail +# function to keep sudo from timing out +function func_dont_timeout { + while true; do + sudo -v + sleep 60 + done +} + +# check if user is root +if [ "$EUID" -ne 0 ]; then + sudo -v +fi + +# keep sudo active in background +func_dont_timeout & + # get current directory setupdir=$(pwd)