From c8b4c7fc18d6082d3e19f3da06c27c6b48fc2b51 Mon Sep 17 00:00:00 2001 From: Bram Prieshof Date: Wed, 9 Sep 2020 14:22:15 +0200 Subject: [PATCH] Added branchtype to allow for tags --- AppendCMS.sh | 40 ++++----- AppendModule.sh | 32 ++++---- CMS/Backend/apache-conf.sh | 2 +- CMS/Backend/conf.sh | 2 +- CMS/Backend/nginx-conf.sh | 2 +- CMS/nextcloud/apache-conf.sh | 2 +- CMS/nextcloud/conf.sh | 8 +- CMS/nextcloud/nginx-conf.sh | 2 +- CMS/none/apache-conf.sh | 2 +- CMS/none/conf.sh | 2 +- CMS/none/nginx-conf.sh | 2 +- CMS/none/nginx_nonphp-conf.sh | 2 +- CMS/wordpress/apache-conf.sh | 2 +- CMS/wordpress/conf.sh | 10 +-- CMS/wordpress/nginx-conf.sh | 2 +- CoreModules/apache/appendCMS-conf.sh | 8 +- CoreModules/apache/conf.sh | 20 ++--- CoreModules/generic/conf.sh | 10 +-- CoreModules/nginx/appendCMS-conf.sh | 8 +- CoreModules/nginx/conf.sh | 24 +++--- CoreModules/nginx_nonphp/appendCMS-conf.sh | 8 +- CoreModules/nginx_nonphp/conf.sh | 14 ++-- PhpUpdater.sh | 4 +- Scripts/EnableSSL.sh | 2 +- Scripts/SMI.sh | 8 +- installer.sh | 95 +++++++++++----------- 26 files changed, 157 insertions(+), 156 deletions(-) diff --git a/AppendCMS.sh b/AppendCMS.sh index 359ec66..a7df2fd 100644 --- a/AppendCMS.sh +++ b/AppendCMS.sh @@ -8,7 +8,7 @@ if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then source /etc/ICTM/selopts.list source /etc/ICTM/mainvar.list rm /tmp/apt.list -source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/ModulesMenu.list) +source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list) #Setting Menulist to webserver declare -n CMSL="$webserv"CMSL @@ -153,13 +153,13 @@ CMS="${CMS//:}" && CMS="${CMS,,}" # AptList # ##-----------## -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 +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list; then + curl "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list printf " " >>/tmp/apt.list fi -if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-apt.list; then - curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-apt.list >>/tmp/apt.list +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-apt.list; then + curl "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-apt.list >>/tmp/apt.list printf " " >>/tmp/apt.list fi @@ -169,17 +169,17 @@ fi ##-----------## msg " Running preconf for Webserv" -if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/appendCMS-preconf.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/appendCMS-preconf.sh) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/appendCMS-preconf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/appendCMS-preconf.sh) fi msg " 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) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/preconf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/preconf.sh) fi -if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh) fi @@ -197,8 +197,8 @@ cat /tmp/apt.list | xargs $PKGI ##---------------## msg " Running conf for Webserv" -if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/appendCMS-conf.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/appendCMS-conf.sh) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/appendCMS-conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/appendCMS-conf.sh) fi if [ $sslenable = 1 ]; then @@ -214,22 +214,22 @@ msg " Setting up SSL" elif [ $domainwww = 0 ]; then certbot --"$certwebserv" certonly -n -d "$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos fi - if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/ssl-handler.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/ssl-handler.sh) + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/ssl-handler.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/ssl-handler.sh) fi elif [ $sslenable = 0 ]; then site_ext=nossl fi -wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/EnableSSL.sh -O ~/activateSSL-$domain.sh +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/Scripts/EnableSSL.sh -O ~/activateSSL-$domain.sh sed -i -e 's/DOMAINname/'$domain'/' -e 's/CONFname/'$sitename'/' -e 's/DomainWWW/'$domainwww'/' -e 's/Email/'$email'/' -e 's/WebServer/'$webserv'/' ~/activateSSL-$domain.sh msg " 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) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$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) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh) fi ##--------------------------## diff --git a/AppendModule.sh b/AppendModule.sh index 085f636..7dc6d78 100644 --- a/AppendModule.sh +++ b/AppendModule.sh @@ -12,7 +12,7 @@ if [ ! -f "/etc/ICTM/selopts.list" ] || [ ! -f "/etc/ICTM/mainvar.list" ] ; then source /etc/ICTM/selopts.list source /etc/ICTM/mainvar.list rm /tmp/apt.list -source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/ModulesMenu.list) +source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list) #Setting Menulist to webserver declare -n CMSL="$webserv"CMSL @@ -151,17 +151,17 @@ option="$option""$aonoption" msg " 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") + modListed=$(wget -t7 -qO - "$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/branch/"$branch"/SubModules/"$val1"/apt.list; then - curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/apt.list >>/tmp/apt.list + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/apt.list; then + curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/apt.list >>/tmp/apt.list printf " " >>/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 + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-apt.list; then + curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-apt.list >>/tmp/apt.list printf " " >>/tmp/apt.list fi else @@ -185,16 +185,16 @@ done msg " Running preconf for Options" for val1 in ${option[*]}; do echo "$val1" #TMP - modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1") + modListed=$(wget -t7 -qO - "$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/branch/"$branch"/SubModules/"$val1"/preconf.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/preconf.sh) + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/preconf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$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) + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh) fi else #Fetching from remote repo @@ -224,16 +224,16 @@ cat /tmp/apt.list | xargs $PKGI msg " Running conf for Options" for val1 in ${option[*]}; do echo "$val1" #TMP - modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1") + modListed=$(wget -t7 -qO - "$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/branch/"$branch"/SubModules/"$val1"/conf.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/conf.sh) + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$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) + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh) fi else #Fetching from remote repo diff --git a/CMS/Backend/apache-conf.sh b/CMS/Backend/apache-conf.sh index 1e97fa2..db5b1f6 100644 --- a/CMS/Backend/apache-conf.sh +++ b/CMS/Backend/apache-conf.sh @@ -1,4 +1,4 @@ -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/Backend/apache-siteBackend-unconfigured -O /tmp/apache-siteconf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/apache-siteBackend-unconfigured -O /tmp/apache-siteconf sed -i -e 's/PHPver/'$phpver'/' -e 's/DOMAINname/'$hostname'/' /tmp/apache-siteconf sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/Backend_"$site_ext".conf systemctl reload apache2 \ No newline at end of file diff --git a/CMS/Backend/conf.sh b/CMS/Backend/conf.sh index d964cdc..42ae7b1 100644 --- a/CMS/Backend/conf.sh +++ b/CMS/Backend/conf.sh @@ -1,5 +1,5 @@ #Backend PHP Pool -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/Backend/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/Backend.conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/Backend.conf sed -i 's/PHPver/'$phpver'/' /etc/php/"$phpver"/fpm/pool.d/Backend.conf groupadd Backend useradd -g Backend Backend diff --git a/CMS/Backend/nginx-conf.sh b/CMS/Backend/nginx-conf.sh index 9de34d4..a92e094 100644 --- a/CMS/Backend/nginx-conf.sh +++ b/CMS/Backend/nginx-conf.sh @@ -1,4 +1,4 @@ -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/Backend/nginx-siteBackend-unconfigured -O /tmp/nginx-backendconf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/nginx-siteBackend-unconfigured -O /tmp/nginx-backendconf sed -i -e 's/PHPver/'$phpver'/' -e 's/DOMAINname/'$hostname'/' /tmp/nginx-backendconf sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-backendconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/Backend_"$site_ext" systemctl reload nginx diff --git a/CMS/nextcloud/apache-conf.sh b/CMS/nextcloud/apache-conf.sh index 5a15506..f3a43e9 100644 --- a/CMS/nextcloud/apache-conf.sh +++ b/CMS/nextcloud/apache-conf.sh @@ -1,5 +1,5 @@ #Apache -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/Apache-unconfigured -O /tmp/apache-siteconf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/Apache-unconfigured -O /tmp/apache-siteconf sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/apache-siteconf sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/"$sitename"_"$site_ext".conf chown "$sitename":"$sitename" -R /var/www/"$domain"/html diff --git a/CMS/nextcloud/conf.sh b/CMS/nextcloud/conf.sh index b4962ff..4522411 100644 --- a/CMS/nextcloud/conf.sh +++ b/CMS/nextcloud/conf.sh @@ -1,5 +1,5 @@ #PHP Pool -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf sed -i -e 's/PHPver/'$phpver'/' -e 's/SITEname/'$sitename'/' -e 's/DOMAINname/'$domain'/' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf groupadd "$sitename" useradd -g "$sitename" "$sitename" @@ -39,9 +39,9 @@ EOF chown "$sitename":"$sitename" -R /var/www/"$domain"/html #Makeing nextcloud Finalize script and setting login Notice -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/nextcloud-init.sh -O ~/NextcloudInit-"$sitename".sh +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/nextcloud-init.sh -O ~/NextcloudInit-"$sitename".sh sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/NextcloudInit-"$sitename".sh -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/MotdNextCloud -O /etc/update-motd.d/51-nextnotice +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/MotdNextCloud -O /etc/update-motd.d/51-nextnotice sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-nextnotice chmod +x /etc/update-motd.d/51-nextnotice @@ -52,7 +52,7 @@ chmod 774 -R /var/log/nextcloud ln -s /var/www/"$domain"/html/data/nextcloud.log /var/log/nextcloud/"$sitename" #fail2ban -wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Jails/nextcloud_unconfigured -O /etc/fail2ban/jail.d/"$sitename"-nextcloud.local +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/nextcloud_unconfigured -O /etc/fail2ban/jail.d/"$sitename"-nextcloud.local sed -i 's/SITEname/'$sitename'/' /etc/fail2ban/jail.d/"$sitename"-nextcloud.local systemctl reload php"$phpver"-fpm \ No newline at end of file diff --git a/CMS/nextcloud/nginx-conf.sh b/CMS/nextcloud/nginx-conf.sh index c6e88d2..73e5ab6 100644 --- a/CMS/nextcloud/nginx-conf.sh +++ b/CMS/nextcloud/nginx-conf.sh @@ -1,7 +1,7 @@ #Nextcloud major release version #Configuring nginx -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/nextcloud/Nginx-unconfigured -O /tmp/nginx-siteconf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/nextcloud/Nginx-unconfigured -O /tmp/nginx-siteconf sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/nginx-siteconf sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$sitename"_"$site_ext" if [ $sslenable = 0 ]; then diff --git a/CMS/none/apache-conf.sh b/CMS/none/apache-conf.sh index f9793ec..e94f199 100644 --- a/CMS/none/apache-conf.sh +++ b/CMS/none/apache-conf.sh @@ -1,4 +1,4 @@ -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Apache-unconfigured -O /tmp/apache-siteconf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/none/Apache-unconfigured -O /tmp/apache-siteconf sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/apache-siteconf sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/"$sitename"_"$site_ext".conf mkdir -p /var/www/"$domain"/html diff --git a/CMS/none/conf.sh b/CMS/none/conf.sh index 000b571..a72c46f 100644 --- a/CMS/none/conf.sh +++ b/CMS/none/conf.sh @@ -2,7 +2,7 @@ if [ $webserv != nginx_nonphp ]; then #Setup PHP Pool -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/none/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf sed -i -e 's/PHPver/'$phpver'/' -e 's/SITEname/'$sitename'/' -e 's/DOMAINname/'$domain'/' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf groupadd "$sitename" useradd -g "$sitename" "$sitename" diff --git a/CMS/none/nginx-conf.sh b/CMS/none/nginx-conf.sh index 8990392..d08d959 100644 --- a/CMS/none/nginx-conf.sh +++ b/CMS/none/nginx-conf.sh @@ -1,4 +1,4 @@ -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Nginx-unconfigured -O /tmp/nginx-siteconf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/none/Nginx-unconfigured -O /tmp/nginx-siteconf sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/nginx-siteconf sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$sitename"_"$site_ext" mkdir -p /var/www/"$domain"/html diff --git a/CMS/none/nginx_nonphp-conf.sh b/CMS/none/nginx_nonphp-conf.sh index 6df107b..2add71e 100644 --- a/CMS/none/nginx_nonphp-conf.sh +++ b/CMS/none/nginx_nonphp-conf.sh @@ -1,4 +1,4 @@ -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/none/Nginx_nonphp-unconfigured -O /tmp/nginx-siteconf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/none/Nginx_nonphp-unconfigured -O /tmp/nginx-siteconf sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/nginx-siteconf sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$sitename"_"$site_ext" mkdir -p /var/www/"$domain"/html diff --git a/CMS/wordpress/apache-conf.sh b/CMS/wordpress/apache-conf.sh index 5145bbb..88e2c4b 100644 --- a/CMS/wordpress/apache-conf.sh +++ b/CMS/wordpress/apache-conf.sh @@ -1,4 +1,4 @@ -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/Apache-unconfigured -O /tmp/apache-siteconf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/Apache-unconfigured -O /tmp/apache-siteconf sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/apache-siteconf sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/apache-siteconf' -e '/#ConfHere/c\' /etc/apache2/sites-available/"$sitename"_"$site_ext".conf diff --git a/CMS/wordpress/conf.sh b/CMS/wordpress/conf.sh index 8a234ab..71dd2c2 100644 --- a/CMS/wordpress/conf.sh +++ b/CMS/wordpress/conf.sh @@ -27,12 +27,12 @@ tar -C /var/www/"$domain"/html -xzf /tmp/wp.tar.gz --strip 1 rm /var/www/"$domain"/html/wp-config-sample.php #Configuring WordPress -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/WordPress-unconfigured -O /var/www/"$domain"/html/wp-config.php +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/WordPress-unconfigured -O /var/www/"$domain"/html/wp-config.php sed -i -e 's/DBPass/'$db_pass'/' -e 's/DBUser/'$db_user'/' -e 's/DBName/'$db_name'/' -e 's/DOMAINname/'$domain'/' /var/www/"$domain"/html/wp-config.php printf '%s\n' "g/WPsalty/d" a "$WPSalts" . w | ed -s /var/www/"$domain"/html/wp-config.php #PHP Pool -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/Fpm-Pool.conf-unconfigured -O /etc/php/"$phpver"/fpm/pool.d/"$sitename".conf sed -i -e 's/PHPver/'$phpver'/' -e 's/SITEname/'$sitename'/' -e 's/DOMAINname/'$domain'/' /etc/php/"$phpver"/fpm/pool.d/$sitename.conf groupadd "$sitename" useradd -g "$sitename" "$sitename" @@ -41,15 +41,15 @@ systemctl reload php"$phpver"-fpm #fail2ban if [ ! -f /etc/fail2ban/jail.d/wordpress-syslog.local ]; then - wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Jails/wordpress-syslog.jail -O /etc/fail2ban/jail.d/wordpress-syslog.local + wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/wordpress-syslog.jail -O /etc/fail2ban/jail.d/wordpress-syslog.local fi #Setting Permsissions chown "$sitename":"$sitename" -R /var/www/"$domain"/html #Makeing wordpress Finalize script and setting login Notice -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/wordpress-init.sh -O ~/WordpressInit-"$sitename".sh +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/wordpress-init.sh -O ~/WordpressInit-"$sitename".sh sed -i -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' ~/WordpressInit-"$sitename".sh -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/MotdWordpress -O /etc/update-motd.d/51-wpnotice +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/MotdWordpress -O /etc/update-motd.d/51-wpnotice sed -i -e 's/SITEname/'$sitename'/' /etc/update-motd.d/51-wpnotice chmod +x /etc/update-motd.d/51-wpnotice \ No newline at end of file diff --git a/CMS/wordpress/nginx-conf.sh b/CMS/wordpress/nginx-conf.sh index f2acf64..0048116 100644 --- a/CMS/wordpress/nginx-conf.sh +++ b/CMS/wordpress/nginx-conf.sh @@ -1,5 +1,5 @@ #Configuring nginx -wget -q -t7 "$repo"/raw/branch/"$branch"/CMS/wordpress/Nginx-unconfigured -O /tmp/nginx-siteconf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CMS/wordpress/Nginx-unconfigured -O /tmp/nginx-siteconf sed -i -e 's/PHPver/'$phpver'/g' -e 's/DOMAINname/'$domain'/' -e 's/SITEname/'$sitename'/' /tmp/nginx-siteconf sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e '/#ConfHere1/ r /tmp/nginx-siteconf' -e '/#ConfHere/c\' /etc/nginx/sites-available/"$sitename"_"$site_ext" diff --git a/CoreModules/apache/appendCMS-conf.sh b/CoreModules/apache/appendCMS-conf.sh index 6851d69..c6fbdef 100644 --- a/CoreModules/apache/appendCMS-conf.sh +++ b/CoreModules/apache/appendCMS-conf.sh @@ -4,19 +4,19 @@ if [ $domainwww = 1 ]; then #non-ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf echo "" >> /etc/apache2/sites-available/"$sitename"_nossl.conf #ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf echo "" >> /etc/apache2/sites-available/"$sitename"_ssl.conf fi #non-ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf sed -i -e 's/DOMAINname/'$domain'/' /etc/apache2/sites-available/"$sitename"_nossl.conf ln -s /etc/apache2/sites-available/"$sitename"_nossl.conf /etc/apache2/sites-enabled/010-"$sitename".conf #ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf sed -i -e 's/DOMAINname/'$domain'/' /etc/apache2/sites-available/"$sitename"_ssl.conf systemctl reload apache2 \ No newline at end of file diff --git a/CoreModules/apache/conf.sh b/CoreModules/apache/conf.sh index f61ac82..0aeb4d3 100644 --- a/CoreModules/apache/conf.sh +++ b/CoreModules/apache/conf.sh @@ -9,41 +9,41 @@ a2dismod mpm_prefork a2enmod actions fcgid alias proxy_fcgi ssl headers http2 setenvif socache_shmcb mkdir -p /etc/apache2/snippets/ -wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/snippets-ssl.conf -O /etc/apache2/snippets/apa-ssl.conf -wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/conf-custom.conf -O /etc/apache2/conf-enabled/zzz-custom.conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/snippets-ssl.conf -O /etc/apache2/snippets/apa-ssl.conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/conf-custom.conf -O /etc/apache2/conf-enabled/zzz-custom.conf #Catch all (ip and unconfigured domains) -wget - -t7 "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_CatchAll -O /etc/apache2/sites-available/CatchAll.conf +wget - -t7 "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_CatchAll -O /etc/apache2/sites-available/CatchAll.conf ln -s /etc/apache2/sites-available/CatchAll.conf /etc/apache2/sites-enabled/999-CatchAll.conf if [ $domainwww = 1 ]; then #non-ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-wwwredir >> /etc/apache2/sites-available/"$sitename"_nossl.conf echo "" >> /etc/apache2/sites-available/"$sitename"_nossl.conf #ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-wwwredir >> /etc/apache2/sites-available/"$sitename"_ssl.conf echo "" >> /etc/apache2/sites-available/"$sitename"_ssl.conf fi #non-ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/"$sitename"_nossl.conf sed -i -e 's/DOMAINname/'$domain'/' /etc/apache2/sites-available/"$sitename"_nossl.conf ln -s /etc/apache2/sites-available/"$sitename"_nossl.conf /etc/apache2/sites-enabled/010-"$sitename".conf #ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/"$sitename"_ssl.conf sed -i -e 's/DOMAINname/'$domain'/' /etc/apache2/sites-available/"$sitename"_ssl.conf #non-ssl-Backend -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/Backend_nossl.conf +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site-unconfigured >> /etc/apache2/sites-available/Backend_nossl.conf sed -i -e 's/DOMAINname/'$hostname'/' /etc/apache2/sites-available/Backend_nossl.conf ln -s /etc/apache2/sites-available/Backend_nossl.conf /etc/apache2/sites-enabled/010-Backend.conf #ssl-Backend -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/Backend_ssl.conf +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/apache/config/apache2/site_ssl-unconfigured >> /etc/apache2/sites-available/Backend_ssl.conf sed -i -e 's/DOMAINname/'$hostname'/' /etc/apache2/sites-available/Backend_ssl.conf mkdir -p /opt/toggle -wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_APACHE.sh -O /opt/toggle/toggle-PhpMyAdmin.sh +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_APACHE.sh -O /opt/toggle/toggle-PhpMyAdmin.sh # custom Welcome page diff --git a/CoreModules/generic/conf.sh b/CoreModules/generic/conf.sh index 1c36991..9f41882 100644 --- a/CoreModules/generic/conf.sh +++ b/CoreModules/generic/conf.sh @@ -30,18 +30,18 @@ echo "y" | ufw enable > $OUTPUT 2>&1 ##------------## #General config -wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/jail.local -O /etc/fail2ban/jail.local +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/jail.local -O /etc/fail2ban/jail.local #Custom Fiters -wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Filters/nextcloud.filter -O /etc/fail2ban/filter.d/nextcloud.local -wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Filters/phpmyadmin-authlog.filter -O /etc/fail2ban/filter.d/phpmyadmin-authlog.local +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Filters/nextcloud.filter -O /etc/fail2ban/filter.d/nextcloud.local +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Filters/phpmyadmin-authlog.filter -O /etc/fail2ban/filter.d/phpmyadmin-authlog.local wget -q -t7 https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-hard.conf -O /etc/fail2ban/filter.d/wordpress-hard.local wget -q -t7 https://plugins.svn.wordpress.org/wp-fail2ban/trunk/filters.d/wordpress-soft.conf -O /etc/fail2ban/filter.d/wordpress-soft.local #General jails rm /etc/fail2ban/jail.d/* -wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Jails/sshd.jail -O /etc/fail2ban/jail.d/sshd.local +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/sshd.jail -O /etc/fail2ban/jail.d/sshd.local if [ -z $disbackendcms ]; then - wget -q -t7 "$repo"/raw/branch/"$branch"/config/fail2ban/Jails/phpmyadmin.jail -O /etc/fail2ban/jail.d/phpmyadmin.local + wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/config/fail2ban/Jails/phpmyadmin.jail -O /etc/fail2ban/jail.d/phpmyadmin.local fi diff --git a/CoreModules/nginx/appendCMS-conf.sh b/CoreModules/nginx/appendCMS-conf.sh index 8dfa695..6f9b95a 100644 --- a/CoreModules/nginx/appendCMS-conf.sh +++ b/CoreModules/nginx/appendCMS-conf.sh @@ -4,19 +4,19 @@ if [ $domainwww = 1 ]; then #non-ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl echo "" >> /etc/nginx/sites-available/"$sitename"_nossl #ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl echo "" >> /etc/nginx/sites-available/"$sitename"_ssl fi #non-ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_nossl ln -s /etc/nginx/sites-available/"$sitename"_nossl /etc/nginx/sites-enabled/"$sitename" #ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_ssl systemctl reload nginx \ No newline at end of file diff --git a/CoreModules/nginx/conf.sh b/CoreModules/nginx/conf.sh index 07905af..2299251 100644 --- a/CoreModules/nginx/conf.sh +++ b/CoreModules/nginx/conf.sh @@ -5,39 +5,39 @@ systemctl stop nginx ############# mkdir -p /var/www/html /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/snippets /etc/nginx/modules-available /etc/nginx/modules-enabled /etc/nginx/snippets/ -wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/fastcgi.conf -O /etc/nginx/fastcgi.conf -wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/fastcgi-php.conf -O /etc/nginx/snippets/fastcgi-php.conf -wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/snippets-ssl.conf -O /etc/nginx/snippets/ngx-ssl.conf -wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/nginx-default.conf -O /etc/nginx/nginx.conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/fastcgi.conf -O /etc/nginx/fastcgi.conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/fastcgi-php.conf -O /etc/nginx/snippets/fastcgi-php.conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/snippets-ssl.conf -O /etc/nginx/snippets/ngx-ssl.conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/nginx-default.conf -O /etc/nginx/nginx.conf if [ $domainwww = 1 ]; then #non-ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl echo "" >> /etc/nginx/sites-available/"$sitename"_nossl #ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl echo "" >> /etc/nginx/sites-available/"$sitename"_ssl fi #non-ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_nossl ln -s /etc/nginx/sites-available/"$sitename"_nossl /etc/nginx/sites-enabled/"$sitename" #ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_ssl #Backend ##non-ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/Backend_nossl +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/Backend_nossl sed -i -e 's/DOMAINname/'$hostname'/' /etc/nginx/sites-available/Backend_nossl ln -s /etc/nginx/sites-available/Backend_nossl /etc/nginx/sites-enabled/Backend ##ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/Backend_ssl +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/Backend_ssl sed -i -e 's/DOMAINname/'$hostname'/' /etc/nginx/sites-available/Backend_ssl mkdir -p /opt/toggle -wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/toggles/toggle-Netdata_NGINX.sh -O /opt/toggle/toggle-Netdata.sh -wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_NGINX.sh -O /opt/toggle/toggle-PhpMyAdmin.sh +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-Netdata_NGINX.sh -O /opt/toggle/toggle-Netdata.sh +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/Scripts/toggles/toggle-PhpMyAdmin_NGINX.sh -O /opt/toggle/toggle-PhpMyAdmin.sh # custom Welcome page echo "$webserv is functioning normally" > /usr/share/nginx/html/index.html diff --git a/CoreModules/nginx_nonphp/appendCMS-conf.sh b/CoreModules/nginx_nonphp/appendCMS-conf.sh index 8dfa695..6f9b95a 100644 --- a/CoreModules/nginx_nonphp/appendCMS-conf.sh +++ b/CoreModules/nginx_nonphp/appendCMS-conf.sh @@ -4,19 +4,19 @@ if [ $domainwww = 1 ]; then #non-ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl echo "" >> /etc/nginx/sites-available/"$sitename"_nossl #ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl echo "" >> /etc/nginx/sites-available/"$sitename"_ssl fi #non-ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_nossl ln -s /etc/nginx/sites-available/"$sitename"_nossl /etc/nginx/sites-enabled/"$sitename" #ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_ssl systemctl reload nginx \ No newline at end of file diff --git a/CoreModules/nginx_nonphp/conf.sh b/CoreModules/nginx_nonphp/conf.sh index 5873211..fe0506c 100644 --- a/CoreModules/nginx_nonphp/conf.sh +++ b/CoreModules/nginx_nonphp/conf.sh @@ -5,24 +5,24 @@ systemctl stop nginx ############# mkdir -p /var/www/html /etc/nginx/sites-available /etc/nginx/sites-enabled /etc/nginx/snippets /etc/nginx/modules-available /etc/nginx/modules-enabled /etc/nginx/snippets/ -wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/fastcgi.conf -O /etc/nginx/fastcgi.conf -wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/snippets-ssl.conf -O /etc/nginx/snippets/ngx-ssl.conf -wget -q -t7 "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/nginx-default.conf -O /etc/nginx/nginx.conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/fastcgi.conf -O /etc/nginx/fastcgi.conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/snippets-ssl.conf -O /etc/nginx/snippets/ngx-ssl.conf +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/nginx-default.conf -O /etc/nginx/nginx.conf if [ $domainwww = 1 ]; then #non-ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-wwwredir >> /etc/nginx/sites-available/"$sitename"_nossl echo "" >> /etc/nginx/sites-available/"$sitename"_nossl #ssl - wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl + wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-wwwredir >> /etc/nginx/sites-available/"$sitename"_ssl echo "" >> /etc/nginx/sites-available/"$sitename"_ssl fi #non-ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site-unconfigured >> /etc/nginx/sites-available/"$sitename"_nossl sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_nossl ln -s /etc/nginx/sites-available/"$sitename"_nossl /etc/nginx/sites-enabled/"$sitename" #ssl -wget -q -t7 -O - "$repo"/raw/branch/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl +wget -q -t7 -O - "$repo"/raw/"$branchtype"/"$branch"/CoreModules/nginx/config/nginx/site_ssl-unconfigured >> /etc/nginx/sites-available/"$sitename"_ssl sed -i -e 's/DOMAINname/'$domain'/' /etc/nginx/sites-available/"$sitename"_ssl # custom Welcome page diff --git a/PhpUpdater.sh b/PhpUpdater.sh index 50bf92d..cdd0221 100644 --- a/PhpUpdater.sh +++ b/PhpUpdater.sh @@ -86,6 +86,6 @@ systemctl reload php$newphpver-fpm sed -i "/phpver/c\phpver=\"$newphpver\"" /etc/ICTM/mainvar.list -if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/phpupdate-handeler.sh) fi \ No newline at end of file diff --git a/Scripts/EnableSSL.sh b/Scripts/EnableSSL.sh index d50388a..14f49d6 100644 --- a/Scripts/EnableSSL.sh +++ b/Scripts/EnableSSL.sh @@ -34,7 +34,7 @@ fi #Restoring config sed -i -e "0,/^#ConfHere/s/\(^#Conf.*\)/#ConfHere1 /" -e "/#ConfHere1/ r /tmp/"$sitename"-config" -e '/#ConfHere/c\' /etc/"$webservice"/sites-available/"$sitename"_ssl"$ext" -source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/ssl-handler.sh) +source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/ssl-handler.sh) #Remove script while true; do diff --git a/Scripts/SMI.sh b/Scripts/SMI.sh index 94ea125..b563ecc 100644 --- a/Scripts/SMI.sh +++ b/Scripts/SMI.sh @@ -30,13 +30,13 @@ branch=master ###Select Module type ##Uncomment for CoreModules -mtype=""$repo"/raw/branch/"$branch"/CoreModules/"$SMI_ModuleName"" +mtype=""$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$SMI_ModuleName"" ##Uncomment for SubModules -#mtype=""$repo"/raw/branch/"$branch"/SubModules/"$SMI_ModuleName"" +#mtype=""$repo"/raw/"$branchtype"/"$branch"/SubModules/"$SMI_ModuleName"" ##Uncomment for CMS -#mtype=""$repo"/raw/branch/"$branch"/CMS/"$SMI_ModuleName"" +#mtype=""$repo"/raw/"$branchtype"/"$branch"/CMS/"$SMI_ModuleName"" ##Uncomment for External Module -#mtype=""$repo"/raw/branch/"$branch"" +#mtype=""$repo"/raw/"$branchtype"/"$branch"" #SelfBuilding Vars PKGI="${PKGM} install -y" diff --git a/installer.sh b/installer.sh index 421384a..a3e0963 100644 --- a/installer.sh +++ b/installer.sh @@ -25,6 +25,7 @@ fi #Git-repo repo=https://git.ictmaatwerk.com/bprieshof/UBU-Web-V2 branch=master +branchtype=branch #=branch for branch and =tag for release #Installer-config phpver=7.4 PHPMyadmin=1 #Overwriten by cms's without php @@ -181,7 +182,7 @@ $PKGI curl > $OUTPUT 2>&1 ##--------## #Fetching Menu Entries -source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/ModulesMenu.list) +source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/ModulesMenu.list) if [ $IMODE = n ]; then if [ $TestMode = 0 ]; then @@ -297,10 +298,10 @@ declare -n CMSL="$webserv"CMSL declare -n options="$webserv"Options #Generating APT-List for webserver -curl --silent --show-error "$repo"/raw/branch/"$branch"/CoreModules/generic/apt.list >>/tmp/apt.list +curl --silent --show-error "$repo"/raw/"$branchtype"/"$branch"/CoreModules/generic/apt.list >>/tmp/apt.list printf " " >>/tmp/apt.list -curl --silent --show-error "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/apt.list >>/tmp/apt.list +curl --silent --show-error "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/apt.list >>/tmp/apt.list printf " " >>/tmp/apt.list @@ -310,7 +311,7 @@ printf " " >>/tmp/apt.list mkdir -p /etc/ICTM/sites echo "InstDate=$(date "+%d-%B-%Y")" >> /etc/ICTM/mainvar.list -for storeme in PKGM PKGA PKGI OUTPUT IMODE repo branch webserv phpver sqlver PHPMyadmin email hostname; do +for storeme in PKGM PKGA PKGI OUTPUT IMODE repo branch branchtype webserv phpver sqlver PHPMyadmin email hostname; do declare -p $storeme | cut -d ' ' -f 3- >> /etc/ICTM/mainvar.list done @@ -372,8 +373,8 @@ echo 'SelectedOptions=('$option')' > /etc/ICTM/selopts.list option="${option,,}" && option="${option// /}" && option="${option//:/ }" && option="${option//'"'}" #enableing modules wanted by webserver -if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/reqmodules.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/reqmodules.sh) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/reqmodules.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/reqmodules.sh) fi #Combining selected option with always-on options @@ -381,17 +382,17 @@ option="$option""$aonoption" #Generating APT-list options for val1 in ${option[*]}; do - modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1") + modListed=$(wget -t7 -qO - "$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/branch/"$branch"/SubModules/"$val1"/apt.list; then - curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/apt.list >>/tmp/apt.list + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/apt.list; then + curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/apt.list >>/tmp/apt.list printf " " >>/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 + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-apt.list; then + curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-apt.list >>/tmp/apt.list printf " " >>/tmp/apt.list fi else @@ -433,12 +434,12 @@ fi CMS="${CMS//:}" && CMS="${CMS,,}" #Generating APT-List 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 +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list; then + curl "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/apt.list >>/tmp/apt.list printf " " >>/tmp/apt.list fi -if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-apt.list; then - curl "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-apt.list >>/tmp/apt.list +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-apt.list; then + curl "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-apt.list >>/tmp/apt.list printf " " >>/tmp/apt.list fi @@ -451,26 +452,26 @@ fi msg " Pre-configuring" #Generic Pre-Conf -source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/generic/preconf.sh) +source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/generic/preconf.sh) #Generic WebServer -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) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/preconf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/preconf.sh) fi #Preconfiguring for Modules for val1 in ${option[*]}; do msg "Pre-configuring $val1" - modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1") + modListed=$(wget -t7 -qO - "$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/branch/"$branch"/SubModules/"$val1"/preconf.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/preconf.sh) + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/preconf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$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) + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-preconf.sh) fi else #Fetching from remote repo @@ -484,11 +485,11 @@ for val1 in ${option[*]}; do done #Preconfiguring 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) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/preconf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/preconf.sh) fi -if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-preconf.sh) fi @@ -507,26 +508,26 @@ cat /tmp/apt.list | xargs $PKGI msg " Configuring" #Configuring Generic -source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/generic/conf.sh) +source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/generic/conf.sh) #Configuring WebServer -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) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/conf.sh) fi #Configuring Options for val1 in ${option[*]}; do msg " Configuring $val1" - modListed=$(wget -t7 -qO - "$repo"/raw/branch/master/extModules.list|grep "$val1") + modListed=$(wget -t7 -qO - "$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/branch/"$branch"/SubModules/"$val1"/conf.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/SubModules/"$val1"/conf.sh) + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$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) + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/SubModules/"$val1"/"$webserv"-conf.sh) fi else #Fetching from remote repo @@ -554,35 +555,35 @@ if [ $sslenable = 1 ]; then certbot --"$certwebserv" certonly -n -d "$domain" -m "$email" --hsts --redirect --no-eff-email --agree-tos fi certbot --"$certwebserv" certonly -n -d "$hostname" -m "$email" --hsts --redirect --no-eff-email --agree-tos - if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/ssl-handler.sh; then - sslfr=1 source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CoreModules/"$webserv"/ssl-handler.sh) + if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/ssl-handler.sh; then + sslfr=1 source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CoreModules/"$webserv"/ssl-handler.sh) fi elif [ $sslenable = 0 ]; then site_ext=nossl fi -wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/EnableSSL.sh -O ~/activateSSL-$domain.sh +wget -q -t7 "$repo"/raw/"$branchtype"/"$branch"/Scripts/EnableSSL.sh -O ~/activateSSL-$domain.sh sed -i -e 's/DOMAINname/'$domain'/' -e 's/CONFname/'$sitename'/' -e 's/DomainWWW/'$domainwww'/' -e 's/Email/'$email'/' -e 's/WebServer/'$webserv'/' ~/activateSSL-$domain.sh if [ -z $disbackendcms ]; then -wget -q -t7 "$repo"/raw/branch/"$branch"/Scripts/EnableSSL.sh -O ~/activateSSL-Backend.sh +wget -q -t7 "$repo"/raw/"$branchtype"/"$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 fi msg " Configuring 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) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$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) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/"$CMS"/"$webserv"-conf.sh) fi if [ -z $disbackendcms ]; then -if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/branch/"$branch"/CMS/Backend/conf.sh; then - source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/branch/"$branch"/CMS/Backend/conf.sh) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/conf.sh) fi -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) +if curl --retry 2 --retry-delay 1 --output /dev/null --silent --head --fail "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/"$webserv"-conf.sh; then + source <(curl --retry 7 --retry-delay 5 -s "$repo"/raw/"$branchtype"/"$branch"/CMS/Backend/"$webserv"-conf.sh) fi fi