From 471ed82eb06a2dd84ee66a437020e6b554c81b40 Mon Sep 17 00:00:00 2001 From: Ark74 Date: Wed, 30 Sep 2020 02:03:11 -0500 Subject: [PATCH] Require a minimum of 6 characters for password --- jra_nextcloud.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/jra_nextcloud.sh b/jra_nextcloud.sh index 6497a5c..15e3ee7 100644 --- a/jra_nextcloud.sh +++ b/jra_nextcloud.sh @@ -42,11 +42,12 @@ if [ -z "$NC_USER" ]; then echo "-- This field is mandatory." fi done -while [[ -z "$NC_PASS" ]] +while [ -z "$NC_PASS" ] || [ ${#NC_PASS} -lt 6 ] do read -p "Nextcloud user password: " -r NC_PASS -if [ -z "$NC_PASS" ]; then - echo "-- This field is mandatory." + +if [ -z "$NC_PASS" ] || [ ${#NC_PASS} -lt 6 ]; then + echo -e "-- This field is mandatory. \nPlease make sure it's at least 6 caracters.\n" fi done #Enable HSTS