From 692a231b9a17554dd79742fad54a345b29d79ab7 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 15 Apr 2020 13:52:48 +0200 Subject: [PATCH] Added check if domain exists on the system --- AppendCMS.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/AppendCMS.sh b/AppendCMS.sh index 3db387b..2c313bc 100644 --- a/AppendCMS.sh +++ b/AppendCMS.sh @@ -62,7 +62,6 @@ function LegacyPasswordQuest { if [ -z $passdia ]; then LegacyPasswordQuest; fi mysql -uroot -p"$passdia" -e "" > /dev/null 2>&1 if [ $? = 0 ]; then - echo "Password is correct" password="$passdia" unset passdia else @@ -79,6 +78,7 @@ function LegacyPasswordQuest { if [ $IMODE = n ]; then domain=$(whiptail --nocancel --inputbox " Enter the domain without WWW " 11 82 --title "Config" 3>&1 1>&2 2>&3) + [[ -d "/var/www/"$domain"/html" ]] && msg " This domain already exists on this server, Exiting" 8 78 && exit; if (whiptail --title "Config" --yesno " Does www.${domain} exist in DNS" 8 78); then domainwww=1; else domainwww=0; fi if (whiptail --title "Config" --yesno " Enable SSL on installation?" 11 78); then sslenable=1; else sslenable=0; fi PasswordQuest @@ -90,6 +90,7 @@ if [ $IMODE = l ]; then echo "" >/dev/null echo "Enter the domain without WWW:" read domain + [[ -d "/var/www/"$domain"/html" ]] && echo " This domain already exists on this server, Exiting" && exit; while true; do read -p "Does www.${domain} exist in DNS -> yes/no?" yn case $yn in