Whiptail & MSG alignment, curl flags, debconf-selection
Aligned text for Whiptail and MSG, changed the sizing of some Whiptail windows, added --Silent --Show-Error flags for CURL, removed some unnecessary spaces after lines, added DebConf selection for libssl1.1.
This commit is contained in:
37
installer.sh
37
installer.sh
@@ -36,6 +36,7 @@ TestMode=0
|
||||
PKGA="add-apt-repository"
|
||||
PKGI="${PKGM} install -y"
|
||||
OUTPUT='/dev/null'
|
||||
debconf-set-selections <<< 'libssl1.1:amd64 libraries/restart-without-asking boolean true'
|
||||
|
||||
|
||||
##-------------##
|
||||
@@ -72,14 +73,14 @@ if [ -z $passdiaone ]; then PasswordQuest; fi
|
||||
if [[ ${#passdiaone} -ge 8 && "$passdiaone" == *[[:lower:]]* && "$passdiaone" == *[[:upper:]]* && "$passdiaone" == *[0-9]* && "$passdiaone" == *['!'@#%^\&*()_+]* ]]; then
|
||||
PasswordCheck
|
||||
else
|
||||
whiptail --ok-button Done --msgbox "Password is invalid!" 10 30 && PasswordQuest
|
||||
whiptail --ok-button Done --msgbox " Password is invalid!" 10 30 && PasswordQuest
|
||||
fi
|
||||
}
|
||||
function PasswordCheck {
|
||||
#Checking password
|
||||
passdiatwo=$(whiptail --nocancel --passwordbox "Please re-enter your password" 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||
passdiatwo=$(whiptail --nocancel --passwordbox " Please re-enter your password" 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||
if [ -z $passdiatwo ]; then PasswordCheck; else
|
||||
if [ $passdiaone != $passdiatwo ]; then whiptail --ok-button Done --msgbox "Password does not match!" 10 30 && PasswordQuest;else password="$passdiaone"; unset passdiaone passdiatwo; fi
|
||||
if [ $passdiaone != $passdiatwo ]; then whiptail --ok-button Done --msgbox " Password does not match!" 10 30 && PasswordQuest;else password="$passdiaone"; unset passdiaone passdiatwo; fi
|
||||
fi
|
||||
password="$passdiatwo"
|
||||
}
|
||||
@@ -91,7 +92,7 @@ if [ -z $passdiaone ]; then PasswordQuest; fi
|
||||
if [[ ${#passdiaone} -ge 8 && "$passdiaone" == *[[:lower:]]* && "$passdiaone" == *[[:upper:]]* && "$passdiaone" == *[0-9]* && "$passdiaone" == *['!'@#%^\&*()_+]* ]]; then
|
||||
LegacyPasswordCheck
|
||||
else
|
||||
echo "Password is invalid!" 10 30 && LegacyPasswordQuest
|
||||
echo " Password is invalid!" 10 30 && LegacyPasswordQuest
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -110,7 +111,7 @@ password="$passdiatwo"
|
||||
# Installer-Requirements #
|
||||
##--------------------------##
|
||||
|
||||
msg "Starting installer." 8 78
|
||||
msg " Starting installer" 8 78
|
||||
$PKGM update > $OUTPUT 2>&1
|
||||
$PKGI curl > $OUTPUT 2>&1
|
||||
|
||||
@@ -122,24 +123,24 @@ $PKGI curl > $OUTPUT 2>&1
|
||||
if [ $IMODE = n ]; then
|
||||
if [ $TestMode = 0 ]; then
|
||||
domain=$(whiptail --nocancel --inputbox " Enter the domain without WWW " 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||
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 "Hostname with nxdi.nl" 11 82); then
|
||||
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 " Hostname with nxdi.nl" 11 78); then
|
||||
hostname=$(whiptail --nocancel --inputbox " SystemID (eg: VCH001) without ".nxdi.nl" " 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||
hostname=$hostname".nxdi.nl"
|
||||
else
|
||||
hostname=$(whiptail --nocancel --inputbox " Hostname " 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||
hostname=$(whiptail --nocancel --inputbox " Hostname" 11 78 --title "Config" 3>&1 1>&2 2>&3)
|
||||
fi
|
||||
if (whiptail --title "Config" --yesno "Enable SSL on installation?" 11 82); then
|
||||
if (whiptail --title "Config" --yesno " Enable SSL on installation?" 11 78); then
|
||||
sslenable=1
|
||||
else
|
||||
sslenable=0
|
||||
fi
|
||||
PasswordQuest
|
||||
email=$(whiptail --nocancel --inputbox " Enter the administrator e-mail" 11 82 --title "Config" 3>&1 1>&2 2>&3)
|
||||
email=$(whiptail --nocancel --inputbox " Enter the administrator e-mail" 11 78 --title "Config" 3>&1 1>&2 2>&3)
|
||||
fi
|
||||
webserv=$(whiptail --title "Select Webserver" --radiolist "WebServer" 11 53 5 "Nginx:" "Will install NGINX Webserver." ON "Apache:" "Will install Apache Webserver." OFF 3>&1 1>&2 2>&3)
|
||||
esws=$?
|
||||
[[ "$esws" = 1 ]] && msg "Quiting installer." 8 78 && exit;
|
||||
[[ "$esws" = 1 ]] && msg " Quiting installer" 8 78 && exit;
|
||||
fi
|
||||
|
||||
if [ $IMODE = l ]; then
|
||||
@@ -210,11 +211,11 @@ fi
|
||||
webserv="${webserv//:}" && webserv="${webserv,,}"
|
||||
|
||||
echo "Generating apt list for Generic"
|
||||
curl "$repo"/raw/branch/"$branch"/CoreModules/generic/apt.list >>/tmp/apt.list
|
||||
curl --silent --show-error "$repo"/raw/branch/"$branch"/CoreModules/generic/apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
|
||||
echo "Generating apt list for Webserver"
|
||||
curl "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/apt.list >>/tmp/apt.list
|
||||
curl --silent --show-error "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/apt.list >>/tmp/apt.list
|
||||
printf " " >>/tmp/apt.list
|
||||
|
||||
|
||||
@@ -375,14 +376,12 @@ break;;
|
||||
"None")
|
||||
CMS=None:
|
||||
break;;
|
||||
|
||||
*) echo "$REPLY is not a valid option!";;
|
||||
esac
|
||||
done
|
||||
fi
|
||||
|
||||
CMS="${CMS//:}" && CMS="${CMS,,}"
|
||||
|
||||
echo "Generating Apt List for CMS"
|
||||
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list; then
|
||||
@@ -401,9 +400,8 @@ fi
|
||||
# Pre-Requirements #
|
||||
##--------------------##
|
||||
|
||||
msg " Preconfiguring"
|
||||
sed -i '/Port 22/c\Port 4242' /etc/ssh/sshd_config
|
||||
|
||||
msg "Preconfiguring."
|
||||
$PKGI software-properties-common gnupg > $OUTPUT 2>&1
|
||||
$PKGA universe -y > $OUTPUT 2>&1
|
||||
$PKGA ppa:ondrej/php -y > $OUTPUT 2>&1
|
||||
@@ -450,6 +448,7 @@ for val1 in ${option[*]}; do
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
echo "Running preconf for CMS"
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/preconf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/preconf.sh)
|
||||
@@ -506,6 +505,7 @@ for val1 in ${option[*]}; do
|
||||
fi
|
||||
done
|
||||
|
||||
|
||||
echo "Setting up SSL"
|
||||
if [ $sslenable = 1 ]; then
|
||||
if [ $domainwww = 1 ]; then
|
||||
@@ -522,13 +522,10 @@ sed -i -e 's/DOMAINname/'$domain'/' -e 's/CONFname/'$domain'/' -e 's/DomainWWW/'
|
||||
wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/EnableSSL.sh -O ~/activateSSL-Backend.sh
|
||||
sed -i -e 's/DOMAINname/'$hostname'/' -e 's/CONFname/'Backend'/' -e 's/DomainWWW/'0'/' -e 's/Email/'$email'/' -e 's/WebServer/'$webserv'/' ~/activateSSL-Backend.sh
|
||||
|
||||
|
||||
echo "Running conf for CMS"
|
||||
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/conf.sh)
|
||||
fi
|
||||
|
||||
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh; then
|
||||
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh)
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user