Added sitename

This commit is contained in:
Bram Prieshof
2020-07-16 14:11:16 +02:00
parent 0361e9f1bb
commit cb8b0fc014

View File

@@ -80,6 +80,20 @@ if [ $IMODE = n ]; then
domain=$(whiptail --nocancel --inputbox " Enter the domain without WWW " 11 82 --title "Config" 3>&1 1>&2 2>&3) 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; [[ -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 " Does www.${domain} exist in DNS" 8 78); then domainwww=1; else domainwww=0; fi
if (whiptail --title "Set sitename?" --yesno "Set sitename to ${domain//./_} ?" 8 78); then
echo "Yes"
sitename=${domain//./_}
else
while true; do
sitename=$(whiptail --nocancel --inputbox "Enter sitename, Must NOT contain special characters, except: _" 8 78 --title "Sitename" 3>&1 1>&2 2>&3)
if [[ $sitename == *['!'@#\$%^\&*()+,.]* ]] || [ -z "$sitename" ]
then
whiptail --msgbox " Site can't be empty, or contain a special character except for: _" 11 78
else
break
fi
done
fi
if (whiptail --title "Config" --yesno " Enable SSL on installation?" 11 78); then sslenable=1; else sslenable=0; fi if (whiptail --title "Config" --yesno " Enable SSL on installation?" 11 78); then sslenable=1; else sslenable=0; fi
PasswordQuest PasswordQuest
CMS=$(whiptail --title "What CMS should be installed?" --radiolist "Features" 11 118 5 "${CMSL[@]}" 3>&1 1>&2 2>&3) CMS=$(whiptail --title "What CMS should be installed?" --radiolist "Features" 11 118 5 "${CMSL[@]}" 3>&1 1>&2 2>&3)
@@ -101,6 +115,23 @@ if [ $IMODE = l ]; then
* ) echo "Choose yes of no.";; * ) echo "Choose yes of no.";;
esac esac
done done
read -p "Set sitename to ${domain//./_}? (y/n)" choice
case "$choice" in
y|Y ) echo "yes";sitename=${domain//./_};;
n|N ) echo "no";
while true; do
echo "Please enter sitename, Must NOT contain special characters, except: _";read sitename
if [[ $sitename == *['!'@#\$%^\&*()+,.]* ]] || [ -z "$sitename" ]
then
echo "Site can't be empty, or contain a special character except for: _"
else
break
fi
done
;;
* ) echo "invalid";;
esac
while true; do while true; do
read -p "Enable SSL on installation? -> yes/no?" yn read -p "Enable SSL on installation? -> yes/no?" yn
case $yn in case $yn in