Cleaning up, changing some echo's to msg's

This commit is contained in:
b.waal
2020-04-23 11:04:21 +02:00
parent d758e68141
commit 98fd3ad4c8

View File

@@ -233,11 +233,9 @@ webserv="${webserv//:}" && webserv="${webserv,,}"
declare -n CMSL="$webserv"CMSL
declare -n options="$webserv"Options
echo "Generating apt list for Generic"
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 --silent --show-error "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/apt.list >>/tmp/apt.list
printf " " >>/tmp/apt.list
@@ -278,7 +276,7 @@ opt="${opt%"${opt##*[![:space:]]}"}"
option+="\"$opt\" "
fi
}
echo "The first slection will always return invalid option, please enter the first option twice"
echo "The first selection will always return invalid option, please enter the first option twice"
PS3='Which addons should be installed?'
while :
do
@@ -314,7 +312,6 @@ option="${option,,}" && option="${option// /}" && option="${option//:/ }" && opt
#Combining selected option with always-on options
option="$option""$aonoption"
echo "Generating apt list for Options"
for val1 in ${option[*]}; do
echo "$val1" #TMP
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1")
@@ -367,7 +364,6 @@ 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
curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list
@@ -385,17 +381,14 @@ fi
# Pre-configuring #
##-------------------##
msg " Preconfiguring"
msg " Pre-configuring"
echo "Running preconf for generic"
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/generic/preconf.sh)
echo "Running preconf for Webserv"
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/preconf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/preconf.sh)
fi
echo "Running preconf for Options"
for val1 in ${option[*]}; do
echo "$val1" #TMP
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1")
@@ -421,7 +414,6 @@ for val1 in ${option[*]}; do
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)
fi
@@ -443,16 +435,13 @@ cat /tmp/apt.list | xargs $PKGI
##---------------##
# Configuring #
##---------------##
echo "Running conf for generic"
msg " Configuring"
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/generic/conf.sh)
echo "Running conf for Webserv"
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/conf.sh)
fi
echo "Running conf for Options"
for val1 in ${option[*]}; do
echo "$val1" #TMP
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1")
@@ -478,7 +467,7 @@ for val1 in ${option[*]}; do
done
echo "Setting up SSL"
msg " Setting up SSL" 8 78
if [ $sslenable = 1 ]; then
if [ $domainwww = 1 ]; then
certbot --"$webserv" -n -d "$domain" -d "www.$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos
@@ -494,7 +483,6 @@ 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
@@ -502,7 +490,6 @@ if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$re
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh)
fi
echo "Running conf for Backend"
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/Backend/"$webserv"-conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/Backend/"$webserv"-conf.sh)
fi