mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-03-03 17:27:17 +08:00
Update install_pve.sh
This commit is contained in:
parent
96e6ac04ed
commit
a472e8c087
1 changed files with 11 additions and 11 deletions
|
@ -276,6 +276,15 @@ if ! grep -q "^deb.*pve-no-subscription" /etc/apt/sources.list; then
|
|||
echo "$repo_url" >> /etc/apt/sources.list
|
||||
fi
|
||||
|
||||
# 修正部分网络设置错误
|
||||
if [[ -f "/etc/network/interfaces.d/50-cloud-init" && -f "/etc/network/interfaces" ]]; then
|
||||
if grep -q "auto lo" "/etc/network/interfaces.d/50-cloud-init" && grep -q "iface lo inet loopback" "/etc/network/interfaces.d/50-cloud-init" && grep -q "auto lo" "/etc/network/interfaces" && grep -q "iface lo inet loopback" "/etc/network/interfaces"; then
|
||||
# 从 /etc/network/interfaces.d/50-cloud-init 中删除指定的行
|
||||
sed -i '/auto lo/d' "/etc/network/interfaces.d/50-cloud-init"
|
||||
sed -i '/iface lo inet loopback/d' "/etc/network/interfaces.d/50-cloud-init"
|
||||
fi
|
||||
fi
|
||||
|
||||
# 下载pve
|
||||
apt-get update -y && apt-get full-upgrade -y
|
||||
if [ $? -ne 0 ]; then
|
||||
|
@ -311,15 +320,6 @@ if [[ -n "${CN}" ]]; then
|
|||
sed -i 's|http://mirrors.ustc.edu.cn/proxmox|https://mirrors.tuna.tsinghua.edu.cn/proxmox|g' /usr/share/perl5/PVE/APLInfo.pm
|
||||
fi
|
||||
|
||||
# 修正部分网络设置错误
|
||||
if [[ -f "/etc/network/interfaces.d/50-cloud-init" && -f "/etc/network/interfaces" ]]; then
|
||||
if grep -q "auto lo" "/etc/network/interfaces.d/50-cloud-init" && grep -q "iface lo inet loopback" "/etc/network/interfaces.d/50-cloud-init" && grep -q "auto lo" "/etc/network/interfaces" && grep -q "iface lo inet loopback" "/etc/network/interfaces"; then
|
||||
# 从 /etc/network/interfaces.d/50-cloud-init 中删除指定的行
|
||||
sed -i '/auto lo/d' "/etc/network/interfaces.d/50-cloud-init"
|
||||
sed -i '/iface lo inet loopback/d' "/etc/network/interfaces.d/50-cloud-init"
|
||||
fi
|
||||
fi
|
||||
|
||||
# 安装必备模块并替换apt源中的无效订阅
|
||||
cp /etc/apt/sources.list.d/pve-enterprise.list /etc/apt/sources.list.d/pve-enterprise.list.bak
|
||||
# echo "deb http://download.proxmox.com/debian/pve $(lsb_release -sc) pve-no-subscription" > /etc/apt/sources.list.d/pve-enterprise.list
|
||||
|
@ -330,10 +330,10 @@ install_package lshw
|
|||
install_package iproute2
|
||||
install_package ifupdown2
|
||||
install_package net-tools
|
||||
install_package cloud-init
|
||||
install_package novnc
|
||||
# install_package isc-dhcp-server
|
||||
install_package cloud-init
|
||||
rebuild_cloud_init
|
||||
# install_package isc-dhcp-server
|
||||
|
||||
# 打印内核
|
||||
running_kernel=$(uname -r)
|
||||
|
|
Loading…
Reference in a new issue