Update pve6_to_pve7.sh

This commit is contained in:
spiritLHLS 2023-02-25 19:37:37 +08:00 committed by GitHub
parent 5b7c87ec4e
commit 0a3c848af0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -33,6 +33,9 @@ else
_green "闲置内核已卸载完毕" _green "闲置内核已卸载完毕"
fi fi
# 升级为debian11系统
curl -L https://raw.githubusercontent.com/spiritLHLS/one-click-installation-script/main/todebian11.sh -o todebian11.sh && chmod +x todebian11.sh && bash todebian11.sh
# 检查 PVE 版本是否为最新版本 # 检查 PVE 版本是否为最新版本
if ! [ "$(pveversion -v)" = "$(pveversion -r)" ]; then if ! [ "$(pveversion -v)" = "$(pveversion -r)" ]; then
_yellow "当前 PVE 版本不是最新版本,尝试升级到最新版本" _yellow "当前 PVE 版本不是最新版本,尝试升级到最新版本"
@ -51,23 +54,10 @@ if ! pve6to7 | grep -q "FAILURES: 0"; then
exit 1 exit 1
fi fi
# 检查是否为 Debian 11
if ! [ "$(lsb_release -cs)" = "bullseye" ]; then
_yellow "当前不是 Debian 11尝试升级到 Debian 11"
apt-get update && apt-get dist-upgrade -y
if [ $? -ne 0 ]; then
_red "升级 Debian 11 失败,请检查网络或源配置"
exit 1
else
_green "Debian 升级到 11 成功,请重启服务器"
exit 1
fi
fi
# 升级 PVE # 升级 PVE
_yellow "升级 PVE ..." _yellow "升级 PVE ..."
sed -i 's/buster/bullseye/g' /etc/apt/sources.list sed -i 's/buster/bullseye/g' /etc/apt/sources.list
apt-get update && apt-get dist-upgrade -y apt-get dist-upgrade -y
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
_red "升级 PVE 失败,请检查网络或源配置" _red "升级 PVE 失败,请检查网络或源配置"
exit 1 exit 1