diff --git a/setup/functions.sh b/setup/functions.sh index d402a88..7482b2b 100644 --- a/setup/functions.sh +++ b/setup/functions.sh @@ -9,13 +9,15 @@ function hide_output { $@ &> $OUTPUT # If the command failed, show the output that was captured in the temporary file. - if [ $? != 0 ]; then + E=$? + if [ $E != 0 ]; then # Something failed. echo echo FAILED: $@ echo ----------------------------------------- cat $OUTPUT echo ----------------------------------------- + exit $E fi # Remove temporary file. diff --git a/setup/management.sh b/setup/management.sh index 476abd7..67a6204 100755 --- a/setup/management.sh +++ b/setup/management.sh @@ -4,6 +4,7 @@ source setup/functions.sh apt_install python3-flask links duplicity libyaml-dev python3-dnspython python3-dateutil hide_output pip3 install rtyaml "email_validator==0.1.0-rc4" + # email_validator is repeated in setup/questions.sh # Create a backup directory and a random key for encrypting backups. mkdir -p $STORAGE_ROOT/backup diff --git a/setup/questions.sh b/setup/questions.sh index 08531fe..540e125 100644 --- a/setup/questions.sh +++ b/setup/questions.sh @@ -4,7 +4,14 @@ if [ -z "$NONINTERACTIVE" ]; then # e.g. if we piped a bootstrapping install script to bash to get started. In that # case, the nifty '[ -t 0 ]' test won't work. But with Vagrant we must suppress so we # use a shell flag instead. Really supress any output from installing dialog. - apt_get_quiet install dialog + # + # Also install depencies needed to validate the email address. + echo Installing packages needed for setup... + apt_get_quiet install dialog python3 python3-pip || exit 1 + + # email_validator is repeated in setup/management.sh + hide_output pip3 install "email_validator==0.1.0-rc4" || exit 1 + message_box "Mail-in-a-Box Installation" \ "Hello and thanks for deploying a Mail-in-a-Box! \n\nI'm going to ask you a few questions.