Main:All Added per CMS config for sub-modules

If CMS is installed and a sub-module requires to be configured per CMS,
this is handeled by new 'CMSHook-(pre)conf.sh'
this has been added to Dev Docs

Updated postfix sub-module to use new CMSHook
Added 'itype' var for detection of install script type
Now also storeing  'Allways on modules' in installer as EnabledAons
This commit is contained in:
2021-02-10 15:23:22 +01:00
parent 282851f1ed
commit 81b7e93678
6 changed files with 108 additions and 18 deletions

View File

@@ -1,5 +1,11 @@
#!/bin/bash
###############################
# @author: Bram Prieshof #
# @author: Branco van de Waal #
###############################
itype=Main
##--------------------##
# Legacy/Main Menu #
@@ -435,6 +441,9 @@ if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$re
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/reqmodules.sh)
fi
#saving enabled Allways on modules
echo 'EnabledAons=('$aonoption')' > /etc/ICTM/selopts.list
#Combining selected option with always-on options
option="$option""$aonoption"
@@ -573,6 +582,24 @@ if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$re
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh)
fi
#Preconfiguring module For CMS
for val1 in ${option[*]}; do
modListed=$(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/extModules.list|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/"$branchtype"/"$branch"/SubModules/"$val1"/CMSHook-preconf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/CMSHook-preconf.sh)
fi
else
#Fetching from remote repo
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed"CMSHook-preconf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$modListed"CMSHook-preconf.sh)
fi
fi
done
#Saving updated vars
for storeme in phpver sqlver PHPMyadmin; do
declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list
@@ -695,6 +722,25 @@ if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$re
fi
fi
#Configuring Module for CMS
for val1 in ${option[*]}; do
modListed=$(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/extModules.list|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/"$branchtype"/"$branch"/SubModules/"$val1"/CMSHook-conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/CMSHook-conf.sh)
fi
else
#Fetching from remote repo
if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$modListed"CMSHook-conf.sh; then
source <(curl --retry 7 --retry-delay 5 -s "$modListed"CMSHook-conf.sh)
fi
fi
done
##------------##
# Services #
##------------##