diff --git a/scripts/install-darwin-multi-user.sh b/scripts/install-darwin-multi-user.sh index b1d258e0c..cde40a7f2 100644 --- a/scripts/install-darwin-multi-user.sh +++ b/scripts/install-darwin-multi-user.sh @@ -49,6 +49,14 @@ else readonly IS_HEADLESS='yes' fi +headless() { + if [ "$IS_HEADLESS" = "yes" ]; then + return 0 + else + return 1 + fi +} + contactme() { echo "We'd love to help if you need it." echo "" @@ -179,7 +187,7 @@ failure() { ui_confirm() { _textout "$GREEN$GREEN_UL" "$1" - if [ "$IS_HEADLESS" = "yes" ]; then + if headless; then echo "No TTY, assuming you would say yes :)" return 0 fi @@ -221,9 +229,10 @@ __sudo() { _sudo() { local expl="$1" shift - if __sudo "$expl" "$*"; then - sudo "$@" + if ! headless; then + __sudo "$expl" "$*" fi + sudo "$@" } @@ -620,6 +629,27 @@ EOF chat_about_sudo() { header "let's talk about sudo" + if headless; then + cat <