Updated config fetcher for Options

Updated to support external modules
This commit is contained in:
Bram Prieshof
2020-02-26 13:24:13 +01:00
parent 6e04f54b3b
commit 3996d8395d

View File

@@ -280,19 +280,31 @@ fi
option="${option// /}" && option="${option/:/ }" && option="${option//:}" && option="${option,,}" && option="${option//'"'}"
echo "Generating Apt List for options"
echo "Generating apt list for Options"
for val1 in ${option[*]}; do
echo $val1 #TMP
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-apt.list; then
curl "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-apt.list >>/tmp/apt.list
fi
echo "$val1" #TMP
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.txt|grep "$val1")
#Checking
if test -z "$modListed"
then
#Fetching from local repo
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/apt.list; then
curl "$repo"/raw/branch/"$branch"/SubModules/"$val1"/apt.list >>/tmp/apt.list
curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/apt.list >>/tmp/apt.list
fi
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-apt.list; then
curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-apt.list >>/tmp/apt.list
fi
else
#Fetching from remote repo
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed"apt.list; then
curl --retry 7 --retry-delay 5 -s "$modListed"apt.list >>/tmp/apt.list
fi
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$webserv"-apt.list; then
curl "$modListed""$webserv"-apt.list >>/tmp/apt.list
fi
fi
done
##-------##
# CMS #
##-------##
@@ -369,13 +381,27 @@ fi
echo "Running preconf for Options"
for val1 in ${option[*]}; do
echo $val1 #TMP
echo "$val1" #TMP
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.txt|grep "$val1")
#Checking
if test -z "$modListed"
then
#Fetching from local repo
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/preconf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/preconf.sh)
fi
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh)
fi
else
#Fetching from remote repo
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed"preconf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$modListed"preconf.sh)
fi
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$webserv"-preconf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$modListed""$webserv"-preconf.sh)
fi
fi
done
echo "Running preconf for CMS"
@@ -410,14 +436,27 @@ fi
echo "Running conf for Options"
for val1 in ${option[*]}; do
echo $val1 #TMP
echo "$val1" #TMP
modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.txt|grep "$val1")
#Checking
if test -z "$modListed"
then
#Fetching from local repo
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/conf.sh)
fi
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh)
fi
else
#Fetching from remote repo
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed"conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$modListed"conf.sh)
fi
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed""$webserv"-conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$modListed""$webserv"-conf.sh)
fi
fi
done
echo "Setting up SSL"