Added sitename
This commit is contained in:
35
installer.sh
35
installer.sh
@@ -175,6 +175,20 @@ source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/ModulesM
|
|||||||
if [ $IMODE = n ]; then
|
if [ $IMODE = n ]; then
|
||||||
if [ $TestMode = 0 ]; then
|
if [ $TestMode = 0 ]; 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)
|
||||||
|
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
|
||||||
while true; do
|
while true; do
|
||||||
HostnameQuest
|
HostnameQuest
|
||||||
if [[ "$hostname" == "$domain" ]] || [ -z "$hostname" ]
|
if [[ "$hostname" == "$domain" ]] || [ -z "$hostname" ]
|
||||||
@@ -185,7 +199,6 @@ while true; do
|
|||||||
|
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if (whiptail --title "Config" --yesno " Enable SSL on installation?" 11 78); then
|
if (whiptail --title "Config" --yesno " Enable SSL on installation?" 11 78); then
|
||||||
sslenable=1
|
sslenable=1
|
||||||
else
|
else
|
||||||
@@ -214,8 +227,25 @@ while true; do
|
|||||||
* ) 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
|
||||||
LegacyHostnameQuest
|
LegacyHostnameQuest
|
||||||
|
|
||||||
if [[ "$hostname" == "$domain" ]] || [ -z "$hostname" ]
|
if [[ "$hostname" == "$domain" ]] || [ -z "$hostname" ]
|
||||||
then
|
then
|
||||||
echo "Hostname can't be empty, or be the same as the domain"
|
echo "Hostname can't be empty, or be the same as the domain"
|
||||||
@@ -268,12 +298,13 @@ printf " " >>/tmp/apt.list
|
|||||||
# Storeing vars #
|
# Storeing vars #
|
||||||
##-----------------##
|
##-----------------##
|
||||||
|
|
||||||
mkdir /etc/ICTM
|
mkdir -p /etc/ICTM/sites
|
||||||
echo "InstDate=$(date "+%d-%B-%Y")" >> /etc/ICTM/mainvar.list
|
echo "InstDate=$(date "+%d-%B-%Y")" >> /etc/ICTM/mainvar.list
|
||||||
for storeme in PKGM PKGA PKGI OUTPUT IMODE repo branch webserv phpver sqlver PHPMyadmin email hostname; do
|
for storeme in PKGM PKGA PKGI OUTPUT IMODE repo branch webserv phpver sqlver PHPMyadmin email hostname; do
|
||||||
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list
|
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list
|
||||||
done
|
done
|
||||||
|
|
||||||
|
touch /etc/ICTM/sites/"$sitename"
|
||||||
|
|
||||||
##----------##
|
##----------##
|
||||||
# Addons #
|
# Addons #
|
||||||
|
|||||||
Reference in New Issue
Block a user