From f67ba407ad35b4e427a9db6f3a146daaa0403a8f Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 3 Jun 2020 02:46:08 -0500 Subject: [PATCH] Prevent mandatory variables be empty --- jra_nextcloud.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/jra_nextcloud.sh b/jra_nextcloud.sh index 59002a7..b546a58 100644 --- a/jra_nextcloud.sh +++ b/jra_nextcloud.sh @@ -14,9 +14,27 @@ echo ' ######################################################################## by Software, IT & Networks Ltd ' +while [[ -z "$NC_DOMAIN" ]] +do read -p "Please enter the domain to use for Nextcloud: " -r NC_DOMAIN +if [ -z "$NC_DOMAIN" ]; then + echo "-- This field is mandatory." +fi +done +while [[ -z "$NC_USER" ]] +do read -p "Nextcloud user: " -r NC_USER +if [ -z "$NC_USER" ]; then + echo "-- This field is mandatory." +fi +done +while [[ -z "$NC_PASS" ]] +do read -p "Nextcloud user password: " -r NC_PASS +if [ -z "$NC_PASS" ]; then + echo "-- This field is mandatory." +fi +done #Enable HSTS while [[ "$ENABLE_HSTS" != "yes" && "$ENABLE_HSTS" != "no" ]] do