2023.07.30

This commit is contained in:
spiritlhl 2023-07-30 12:54:17 +00:00
parent 643a8ae458
commit 1d8f6fb6ad

View file

@ -668,8 +668,9 @@ fi
if [ "$system_arch" = "x86" ]; then if [ "$system_arch" = "x86" ]; then
case $version in case $version in
stretch|buster|bullseye|bookworm) stretch|buster|bullseye|bookworm)
if [[ -z "${CN}" || "${CN}" != true ]]; then
repo_url="deb http://download.proxmox.com/debian/pve ${version} pve-no-subscription" repo_url="deb http://download.proxmox.com/debian/pve ${version} pve-no-subscription"
if [[ -n "${CN}" ]]; then else
repo_url="deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian/pve ${version} pve-no-subscription" repo_url="deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian/pve ${version} pve-no-subscription"
fi fi
;; ;;
@ -687,8 +688,9 @@ if [ "$system_arch" = "x86" ]; then
if [ "$confirm" != "y" ]; then if [ "$confirm" != "y" ]; then
exit 1 exit 1
fi fi
if [[ -z "${CN}" || "${CN}" != true ]]; then
repo_url="deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription" repo_url="deb http://download.proxmox.com/debian/pve bullseye pve-no-subscription"
if [[ -n "${CN}" ]]; then else
repo_url="deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian/pve bullseye pve-no-subscription" repo_url="deb https://mirrors.tuna.tsinghua.edu.cn/proxmox/debian/pve bullseye pve-no-subscription"
fi fi
;; ;;
@ -746,14 +748,16 @@ if [ "$system_arch" = "x86" ]; then
elif [ "$system_arch" = "arch" ]; then elif [ "$system_arch" = "arch" ]; then
case $version in case $version in
stretch|buster|bullseye) stretch|buster|bullseye)
if [[ -z "${CN}" || "${CN}" != true ]]; then
repo_url="deb https://global.mirrors.apqa.cn/proxmox/debian/pve bullseye port" repo_url="deb https://global.mirrors.apqa.cn/proxmox/debian/pve bullseye port"
if [[ -n "${CN}" ]]; then else
repo_url="deb https://mirrors.apqa.cn/proxmox/debian/pve bullseye port" repo_url="deb https://mirrors.apqa.cn/proxmox/debian/pve bullseye port"
fi fi
;; ;;
bookworm) bookworm)
if [[ -z "${CN}" || "${CN}" != true ]]; then
repo_url="deb https://global.mirrors.apqa.cn/proxmox/debian/pve bookworm port" repo_url="deb https://global.mirrors.apqa.cn/proxmox/debian/pve bookworm port"
if [[ -n "${CN}" ]]; then else
repo_url="deb https://mirrors.apqa.cn/proxmox/debian/pve bookworm port" repo_url="deb https://mirrors.apqa.cn/proxmox/debian/pve bookworm port"
fi fi
;; ;;
@ -768,10 +772,10 @@ elif [ "$system_arch" = "arch" ]; then
echo "deb https://global.mirrors.apqa.cn/proxmox/debian/pve bullseye port">/etc/apt/sources.list.d/pveport.list echo "deb https://global.mirrors.apqa.cn/proxmox/debian/pve bullseye port">/etc/apt/sources.list.d/pveport.list
;; ;;
esac esac
if [[ -n "${CN}" ]]; then if [[ -z "${CN}" || "${CN}" != true ]]; then
curl https://mirrors.apqa.cn/proxmox/debian/pveport.gpg -o /etc/apt/trusted.gpg.d/pveport.gpg
else
curl https://global.mirrors.apqa.cn/proxmox/debian/pveport.gpg -o /etc/apt/trusted.gpg.d/pveport.gpg curl https://global.mirrors.apqa.cn/proxmox/debian/pveport.gpg -o /etc/apt/trusted.gpg.d/pveport.gpg
else
curl https://mirrors.apqa.cn/proxmox/debian/pveport.gpg -o /etc/apt/trusted.gpg.d/pveport.gpg
fi fi
if ! grep -q "^deb.*port" /etc/apt/sources.list; then if ! grep -q "^deb.*port" /etc/apt/sources.list; then
echo "$repo_url" >> /etc/apt/sources.list echo "$repo_url" >> /etc/apt/sources.list
@ -820,10 +824,12 @@ install_package open-iscsi
rebuild_interfaces rebuild_interfaces
# 如果是国内服务器则替换CT源为国内镜像源 # 如果是国内服务器则替换CT源为国内镜像源
if [[ -n "${CN}" ]]; then if [ "$system_arch" = "x86" ]; then
if [[ "${CN}" == true ]]; then
cp -rf /usr/share/perl5/PVE/APLInfo.pm /usr/share/perl5/PVE/APLInfo.pm.bak cp -rf /usr/share/perl5/PVE/APLInfo.pm /usr/share/perl5/PVE/APLInfo.pm.bak
sed -i 's|http://download.proxmox.com|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm sed -i 's|http://download.proxmox.com|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm
sed -i 's|http://mirrors.ustc.edu.cn/proxmox|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm sed -i 's|http://mirrors.ustc.edu.cn/proxmox|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm
fi
fi fi
# 安装必备模块并替换apt源中的无效订阅 # 安装必备模块并替换apt源中的无效订阅