diff --git a/CoreModules/apache/preconf.sh b/CoreModules/apache/preconf.sh index b6ac760..356770b 100644 --- a/CoreModules/apache/preconf.sh +++ b/CoreModules/apache/preconf.sh @@ -1 +1 @@ -$PKGA ppa:ondrej/apache2 -y -n > $OUTPUT 2>&1 \ No newline at end of file +curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=apache osrel=$shortdist bash \ No newline at end of file diff --git a/CoreModules/generic/preconf.sh b/CoreModules/generic/preconf.sh index bf059c7..a248710 100644 --- a/CoreModules/generic/preconf.sh +++ b/CoreModules/generic/preconf.sh @@ -2,15 +2,15 @@ # Prerequisite packages # ##-----------------------## -$PKGI software-properties-common gnupg > $OUTPUT 2>&1 +curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=init osrel=$shortdist bash ##--------------## # Repositories # ##--------------## -$PKGA universe -y > $OUTPUT 2>&1 -$PKGA ppa:ondrej/php -y -n > $OUTPUT 2>&1 -$PKGA ppa:certbot/certbot -y -n > $OUTPUT 2>&1 +curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=universe osrel=$shortdist bash +curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=php osrel=$shortdist bash +curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=certbot osrel=$shortdist bash ##-------------## diff --git a/CoreModules/nginx/preconf.sh b/CoreModules/nginx/preconf.sh index 559807f..7a12768 100644 --- a/CoreModules/nginx/preconf.sh +++ b/CoreModules/nginx/preconf.sh @@ -1,2 +1 @@ -echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list -curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add - +curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=nginx osrel=$shortdist bash \ No newline at end of file diff --git a/CoreModules/nginx_nonphp/preconf.sh b/CoreModules/nginx_nonphp/preconf.sh index 4f25ec8..79d5d8f 100644 --- a/CoreModules/nginx_nonphp/preconf.sh +++ b/CoreModules/nginx_nonphp/preconf.sh @@ -1,5 +1,4 @@ -echo "deb http://nginx.org/packages/ubuntu `lsb_release -cs` nginx" > /etc/apt/sources.list.d/nginx.list -curl -fsSL https://nginx.org/keys/nginx_signing.key | sudo apt-key add - +curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=nginx osrel=$shortdist bash #Disable PhpMyadmin and Backend cms disbackendcms=1 diff --git a/Scripts/SMI.sh b/Scripts/SMI.sh index b563ecc..238e8d2 100644 --- a/Scripts/SMI.sh +++ b/Scripts/SMI.sh @@ -84,7 +84,7 @@ fi ##--------------------## msg " Preconfiguring" -$PKGI software-properties-common gnupg > $OUTPUT 2>&1 +curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=init osrel=$shortdist bash $PKGM update $PKGM upgrade -y diff --git a/SubModules/redis/preconf.sh b/SubModules/redis/preconf.sh index d7000b2..9c0f2f1 100644 --- a/SubModules/redis/preconf.sh +++ b/SubModules/redis/preconf.sh @@ -1,3 +1,3 @@ #!/bin/bash -$PKGA ppa:chris-lea/redis-server -y -n > $OUTPUT 2>&1 \ No newline at end of file +curl --retry 7 --retry-delay 5 -s https://git.ictmaatwerk.com/VPS-scripts/General/raw/branch/Main/Setup-Repo.sh |repo=redis osrel=$shortdist bash \ No newline at end of file diff --git a/installer.sh b/installer.sh index a3e0963..da2f11b 100644 --- a/installer.sh +++ b/installer.sh @@ -7,12 +7,12 @@ sed -i -e 's/magenta/blue/g' /etc/newt/palette if [ "$1" != "-l" ]; then - PKGM="debconf-apt-progress -- apt" + APTMODE="debconf-apt-progress -- apt" OUTPUT='/dev/null' IMODE=n fi if [ "$1" = "-l" ]; then - PKGM="apt" + APTMODE="apt" OUTPUT='/dev/tty' IMODE=l fi @@ -32,8 +32,43 @@ PHPMyadmin=1 #Overwriten by cms's without php sqlver=8.0 TestMode=0 #PackageManager-config -PKGA="add-apt-repository --no-update" -PKGI="${PKGM} install -y --no-install-recommends" + +dist_ver=$(grep --color=never -Po "^VERSION_ID=\K.*" "/etc/os-release") +dist=$(grep --color=never -Po "^ID=\K.*" "/etc/os-release") + +if [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"18.04"* ]]; then + echo "Ubuntu 18.04 Detected" + PKGM="$APTMODE" + shortdist=ubu1804 +elif [[ "${dist}" == *"ubuntu"* ]] && [[ "${dist_ver}" == *"20.04"* ]]; then + echo "Ubuntu 20.04 Detected" + PKGM="$APTMODE" + PKGI="${PKGM} install -y --no-install-recommends" +echo "This os in not supported" + exit + shortdist=ubu2004 +elif [[ "${dist}" == *"debian"* ]] && [[ "${dist_ver}" == *"10"* ]]; then + echo "Debian 10 Detected" + PKGM="$APTMODE" + PKGI="${PKGM} install -y --no-install-recommends" + PKGLIST="apt.list" + shortdist=deb10 + echo "This os in not supported" + exit +elif [[ "${dist}" == *"centos"* ]] && [[ "${dist_ver}" == *"8"* ]]; then + echo "Centos 8 Detected" + PKGM="dnf" + PKGLIST="dnf.list" + shortdist=cent8 + echo "This os in not supported" + exit +else +echo "This os in not supported" +exit +fi + +unset dist_ver dist APTMODE + ##-------------## # Test-Vars # @@ -311,7 +346,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 branchtype webserv phpver sqlver PHPMyadmin email hostname; do +for storeme in PKGM 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