uid=$(id -u)
if [ "${uid}" -ne 0 ]; then
  # script_path=$([[ "$0" = /* ]] && echo "$0" || echo "$PWD/${0#./}")
  script_path="$(command readlink -f "$0" 2>/dev/null)"
  sudo "$script_path" || (
    echo 'Administrator privileges are required.'
    exit 1
  )
  exit 0
fi
# ask for the administrator password upfront
sudo -v
# keep-alive: update existing `sudo` time stamp until `install.sh` has finished
while true; do sudo -n true; sleep 60; kill -0 "$$" || exit; done 2>/dev/null &
