From 8c2ce5a5faf84f4130a8eb9affca5d14d23cf8c5 Mon Sep 17 00:00:00 2001 From: amidevous Date: Tue, 26 Nov 2024 12:31:03 +0100 Subject: [PATCH 1/4] Update sentora_install.sh --- sentora_install.sh | 79 ++++++++++++++++++++++++++++++---------------- 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/sentora_install.sh b/sentora_install.sh index a733e75..e95611f 100755 --- a/sentora_install.sh +++ b/sentora_install.sh @@ -468,39 +468,62 @@ fi #--- Adapt repositories and packages sources echo -e "\n-- Updating repositories and packages sources" if [[ "$OS" = "CentOs" ]]; then -#EPEL Repo Install - EPEL_BASE_URL="http://dl.fedoraproject.org/pub/epel/$VER/$ARCH"; - if [[ "$VER" = "7" ]]; then - EPEL_FILE=$(wget -q -O- "$EPEL_BASE_URL/Packages/e/" | grep -oP '(?<=href=")epel-release.*(?=">)') - wget "$EPEL_BASE_URL/Packages/e/$EPEL_FILE" - elif [[ "$VER" = "8" ]]; then - EPEL_BASE_URL="http://dl.fedoraproject.org/pub/epel/$VER/Everything/$ARCH"; - EPEL_FILE=$(wget -q -O- "$EPEL_BASE_URL/Packages/e/" | grep -oP '(?<=href=")epel-release.*(?=">)') - wget "$EPEL_BASE_URL/Packages/e/$EPEL_FILE" - else - EPEL_FILE=$(wget -q -O- "$EPEL_BASE_URL/" | grep -oP '(?<=href=")epel-release.*(?=">)') - wget "$EPEL_BASE_URL/$EPEL_FILE" - fi - $PACKAGE_INSTALLER epel-release*.rpm # CHECK THIS - rm "$EPEL_FILE" - - #To fix some problems of compatibility use of mirror centos.org to all users - #Replace all mirrors by base repos to avoid any problems. - sed -i 's|mirrorlist=http://mirrorlist.centos.org|#mirrorlist=http://mirrorlist.centos.org|' "/etc/yum.repos.d/CentOS-Base.repo" - sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://mirror.centos.org|' "/etc/yum.repos.d/CentOS-Base.repo" - - #check if the machine and on openvz - if [ -f "/etc/yum.repos.d/vz.repo" ]; then - sed -i "s|mirrorlist=http://vzdownload.swsoft.com/download/mirrors/centos-$VER|baseurl=http://vzdownload.swsoft.com/ez/packages/centos/$VER/$ARCH/os/|" "/etc/yum.repos.d/vz.repo" - sed -i "s|mirrorlist=http://vzdownload.swsoft.com/download/mirrors/updates-released-ce$VER|baseurl=http://vzdownload.swsoft.com/ez/packages/centos/$VER/$ARCH/updates/|" "/etc/yum.repos.d/vz.repo" - fi - #disable deposits that could result in installation errors + enablerepo() { + if [ -f "/urs/bin/yum-config-manager" ]; then + yum-config-manager --enable $1 &> /dev/null + elif [ -f "/urs/bin/dnf-config-manager" ]; then + dnf-config-manager --enable $1 &> /dev/null + elif [ -f "/etc/yum.repos.d/$1.repo" ]; then + sed -i 's/enabled=0/enabled=1/g' "/etc/yum.repos.d/$1.repo" + fi + } + disablerepo() { - if [ -f "/etc/yum.repos.d/$1.repo" ]; then + if [ -f "/urs/bin/yum-config-manager" ]; then + yum-config-manager --disable $1 &> /dev/null + elif [ -f "/urs/bin/dnf-config-manager" ]; then + dnf-config-manager --disable $1 &> /dev/null + elif [ -f "/etc/yum.repos.d/$1.repo" ]; then sed -i 's/enabled=1/enabled=0/g' "/etc/yum.repos.d/$1.repo" fi } + + +#To fix some problems of compatibility use of mirror centos.org to all users +#Replace all mirrors by base archive vault repos to avoid any problems. +find /etc/yum.repos.d/ -name *.repo -exec sed -i 's|mirrorlist=http://mirrorlist.centos.org|#mirrorlist=http://mirrorlist.centos.org|' {} \; +find /etc/yum.repos.d/ -name *.repo -exec sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|' {} \; + +#check if the machine and on openvz +if [ -f "/etc/yum.repos.d/vz.repo" ]; then + sed -i "s|mirrorlist=http://vzdownload.swsoft.com/download/mirrors/centos-$VER|baseurl=http://vzdownload.swsoft.com/ez/packages/centos/$VER/$ARCH/os/|" "/etc/yum.repos.d/vz.repo" + sed -i "s|mirrorlist=http://vzdownload.swsoft.com/download/mirrors/updates-released-ce$VER|baseurl=http://vzdownload.swsoft.com/ez/packages/centos/$VER/$ARCH/updates/|" "/etc/yum.repos.d/vz.repo" +fi + +enablerepo "base" +enablerepo "centos-base" +enablerepo "centos" +enablerepo "updates" +enablerepo "centos-updates" +enablerepo "extra" +enablerepo "centos-extra" +enablerepo "extras" +enablerepo "centos-extras" +enablerepo "plus" +enablerepo "centos-plus" +enablerepo "contrib" +enablerepo "centos-contrib" +enablerepo "contribs" +enablerepo "centos-contribs" + + +#EPEL Repo Install # epel-release found on extras on RHEL 6,7,8,9,10 and all fork +$PACKAGE_INSTALLER epel-release +yum -y update + + + #disable deposits that could result in installation errors disablerepo "elrepo" disablerepo "epel-testing" disablerepo "remi" From 2115e65405f3ebb5c88b23da6098cad9a9ab2ea3 Mon Sep 17 00:00:00 2001 From: amidevous Date: Tue, 26 Nov 2024 12:40:51 +0100 Subject: [PATCH 2/4] Update ovh-soyoustar-kimsufi-postinstall.sh --- ovh-soyoustar-kimsufi-postinstall.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ovh-soyoustar-kimsufi-postinstall.sh b/ovh-soyoustar-kimsufi-postinstall.sh index 97118b8..af2f198 100644 --- a/ovh-soyoustar-kimsufi-postinstall.sh +++ b/ovh-soyoustar-kimsufi-postinstall.sh @@ -1,13 +1,15 @@ #!/bin/bash # postinstall script for ovh plateform ovh.com soyoustart.com and kimsufi.com +#for centos 6 centos 7 ubuntu old wget http://sentora.org/install -O sentora_install.sh chmod +x sentora_install.sh if [ -f /etc/centos-release ]; then yum -y update yum -y remove bind elif [ -f /etc/lsb-release ]; then +export DEBIAN_FRONTEND=noninteractive apt-get update -apt-get -y dist-upgrade +DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade fi ./sentora_install.sh -t Europe/Paris -d $(hostname) -i public echo "OK" From cf66ef33f6207a75ca48ff001604ff16b9f065fc Mon Sep 17 00:00:00 2001 From: amidevous Date: Tue, 26 Nov 2024 12:41:37 +0100 Subject: [PATCH 3/4] Create ovh-soyoustar-kimsufi-postinstall.new.sh --- ovh-soyoustar-kimsufi-postinstall.new.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 ovh-soyoustar-kimsufi-postinstall.new.sh diff --git a/ovh-soyoustar-kimsufi-postinstall.new.sh b/ovh-soyoustar-kimsufi-postinstall.new.sh new file mode 100644 index 0000000..f8b9fd1 --- /dev/null +++ b/ovh-soyoustar-kimsufi-postinstall.new.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# postinstall script for ovh plateform ovh.com soyoustart.com and kimsufi.com +#for new ubuntu rhel 8 and fork +wget http://sentora.org/install -O sentora_install.sh +chmod +x sentora_install.sh +if [ -f /etc/centos-release ]; then +yum -y update +yum -y remove bind +elif [ -f /etc/lsb-release ]; then +export DEBIAN_FRONTEND=noninteractive +apt-get update +DEBIAN_FRONTEND=noninteractive apt-get -y dist-upgrade +fi +./sentora_install.sh -t Europe/Paris -d $(hostname --hostname) -i public +echo "OK" +exit From 367d98801eff141cb258fda96b2162b9c7002567 Mon Sep 17 00:00:00 2001 From: amidevous Date: Tue, 26 Nov 2024 15:36:46 +0100 Subject: [PATCH 4/4] Update sentora_install.sh --- sentora_install.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sentora_install.sh b/sentora_install.sh index e95611f..741612e 100755 --- a/sentora_install.sh +++ b/sentora_install.sh @@ -470,20 +470,20 @@ echo -e "\n-- Updating repositories and packages sources" if [[ "$OS" = "CentOs" ]]; then enablerepo() { - if [ -f "/urs/bin/yum-config-manager" ]; then + if [ -f "/urs/bin/dnf-3" ]; then + dnf-3 config-manager --enable $1 &> /dev/null + elif [ -f "/urs/bin/yum-config-manager" ]; then yum-config-manager --enable $1 &> /dev/null - elif [ -f "/urs/bin/dnf-config-manager" ]; then - dnf-config-manager --enable $1 &> /dev/null elif [ -f "/etc/yum.repos.d/$1.repo" ]; then sed -i 's/enabled=0/enabled=1/g' "/etc/yum.repos.d/$1.repo" fi } disablerepo() { - if [ -f "/urs/bin/yum-config-manager" ]; then + if [ -f "/urs/bin/dnf-3" ]; then + dnf-3 config-manager --disable $1 &> /dev/null + elif [ -f "/urs/bin/yum-config-manager" ]; then yum-config-manager --disable $1 &> /dev/null - elif [ -f "/urs/bin/dnf-config-manager" ]; then - dnf-config-manager --disable $1 &> /dev/null elif [ -f "/etc/yum.repos.d/$1.repo" ]; then sed -i 's/enabled=1/enabled=0/g' "/etc/yum.repos.d/$1.repo" fi