diff --git a/AppendCMS.sh b/AppendCMS.sh index b9385f9..15d203c 100644 --- a/AppendCMS.sh +++ b/AppendCMS.sh @@ -6,6 +6,7 @@ ############################### itype=AddCMS +ScriptCompat=2 ##-----------------## # Fetching Vars # @@ -15,6 +16,8 @@ if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then source /etc/ICTM/selopts.list source /etc/ICTM/mainvar.list +if [ "$CompatVer" -lt "$ScriptCompat" ]; then echo "Web-V2 is outdated, Please run the Compat-V*.sh updater from the repo, Current version= $CompatVer" && exit ; fi + if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi if [ $webserv != nginx_nonphp ]; then if [ ! -f "/etc/ICTM/phpvar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GeneratePhplist.sh) ; fi diff --git a/AppendModule.sh b/AppendModule.sh index af2b03f..48a8acf 100644 --- a/AppendModule.sh +++ b/AppendModule.sh @@ -6,6 +6,7 @@ ############################### itype=AddMod +ScriptCompat=2 ##-----------------## # Fetching Vars # @@ -15,6 +16,8 @@ if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then source /etc/ICTM/selopts.list source /etc/ICTM/mainvar.list +if [ "$CompatVer" -lt "$ScriptCompat" ]; then echo "Web-V2 is outdated, Please run the Compat-V*.sh updater from the repo, Current version= $CompatVer" && exit ; fi + if [ -z $shortdist ] ; then source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/MicroOSDetect.sh) ; fi if [ $webserv != nginx_nonphp ]; then if [ ! -f "/etc/ICTM/phpvar.list" ] ; then bash <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/Scripts/GeneratePhplist.sh) ; fi diff --git a/Scripts/Compat/Compat-V2.sh b/Scripts/Compat/Compat-V2.sh new file mode 100644 index 0000000..f1bc84a --- /dev/null +++ b/Scripts/Compat/Compat-V2.sh @@ -0,0 +1,20 @@ +if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then echo 'This system is not yet setup, please run the main installer first' && exit ; fi + +source /etc/ICTM/selopts.list +source /etc/ICTM/mainvar.list + +source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list) + +#Setting Menulist to webserver +declare -n CMSL="$webserv"CMSL +declare -n options="$webserv"Options + +#Updating mod lists +option=$(whiptail --nocancel --title "Additional modules" --checklist "Please select enabled features" 11 74 5 "${options[@]}" 3>&1 1>&2 2>&3) +aonoption="/MySQL/" +aonoption="$aonoption /Unattended-Security-Updates/" +aonoption="$aonoption /Backup-Util/" +aonoption="$aonoption /AcmeSH/" +echo 'SelectedOptions=('$option')' > /etc/ICTM/selopts.list +echo 'EnabledAons=('$aonoption')' >> /etc/ICTM/selopts.list +declare -p CompatVer | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list \ No newline at end of file diff --git a/installer.sh b/installer.sh index ad2fc3b..aca61b5 100644 --- a/installer.sh +++ b/installer.sh @@ -32,6 +32,7 @@ fi repo=https://git.ictmaatwerk.com/VPS-scripts/Web-V2 branch=PostfixTesting branchtype=branch #=branch for branch and =tag for release +CompatVer=2 #Installer-config phpver=7.4 PHPMyadmin=1 #Overwriten by cms's without php @@ -374,7 +375,7 @@ fi mkdir -p /etc/ICTM/sites echo "InstDate=$(date "+%d-%B-%Y")" >> /etc/ICTM/mainvar.list -for storeme in PKGM PKGI PKGUC PKGUP PKGLIST OUTPUT IMODE shortdist repo branch branchtype webserv email shortdist hostname; do +for storeme in PKGM PKGI PKGUC PKGUP PKGLIST OUTPUT IMODE shortdist repo branch branchtype webserv email shortdist hostname CompatVer; do declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list done