From 29cff2716b44abdb335b2a11c096659fca6f0780 Mon Sep 17 00:00:00 2001 From: Super Manito <68613938+SuperManito@users.noreply.github.com> Date: Tue, 29 Apr 2025 11:37:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20CentOS=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E5=AE=98=E6=96=B9=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ChangeMirrors.sh | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/ChangeMirrors.sh b/ChangeMirrors.sh index b4ffd29..cde2924 100755 --- a/ChangeMirrors.sh +++ b/ChangeMirrors.sh @@ -1,6 +1,6 @@ #!/bin/bash ## Author: SuperManito -## Modified: 2025-04-25 +## Modified: 2025-04-29 ## License: MIT ## GitHub: https://github.com/SuperManito/LinuxMirrors ## Website: https://linuxmirrors.cn @@ -2112,6 +2112,25 @@ function change_mirrors_RedHat() { esac ## 使用官方源 if [[ "${USE_OFFICIAL_SOURCE}" == "true" ]]; then + ## CentOS 停服专用 + if [[ "${SYSTEM_JUDGMENT}" == "${SYSTEM_CENTOS}" ]]; then + sed -i "s|^#baseurl=http|baseurl=${WEB_PROTOCOL}|g" CentOS-* + sed -i 's|^mirrorlist=|#mirrorlist=|g' CentOS-* + case "${SYSTEM_VERSION_ID_MAJOR}" in + 8) + sed -i "s|mirror.centos.org/\$contentdir|vault.centos.org|g" CentOS-* + sed -i "s/\$releasever/8.5.2111/g" CentOS-* + sed -i "s|vault.centos.org/\$contentdir|vault.centos.org|g" CentOS-Linux-Sources.repo + ;; + 7) + sed -i "s|mirror.centos.org/centos|vault.centos.org|g" CentOS-* + sed -i "s/\$releasever/7.9.2009/g" CentOS-* + sed -i "s|vault.centos.org/centos|vault.centos.org|g" CentOS-Sources.repo + ;; + esac + sed -i "s|mirror.centos.org|vault.centos.org|g" CentOS-* + fi + change_mirrors_or_install_EPEL # EPEL 附加软件包 return fi