From 619c069c06ed7b26a44c6ffaf2647afcb32702f5 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sat, 5 Jan 2019 02:16:05 -0700 Subject: [PATCH] added check for at least one serverName --- .vscode/numbered-bookmarks.json | 2 +- setup.sh | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.vscode/numbered-bookmarks.json b/.vscode/numbered-bookmarks.json index 65c7b37..adba1cd 100644 --- a/.vscode/numbered-bookmarks.json +++ b/.vscode/numbered-bookmarks.json @@ -12,7 +12,7 @@ -1, -1, -1, - 110 + 115 ] } ] diff --git a/setup.sh b/setup.sh index f9d4966..ec2a6cd 100644 --- a/setup.sh +++ b/setup.sh @@ -92,7 +92,12 @@ while true; do read -p "What hostnames should this server answer to? " inputServerName case "${inputServerName}" in '') - break + # check that at least one name as been provided + if [ -z "${serverNames_working}" ]; then + echo -e "\n${err}You must provide at least one hostname${norm}" + else + break + fi ;; [Xx]*) echo -e "\n${cyan}---exiting---\n${norm}"