mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-03-04 01:38:12 +08:00
检测物理接口是否已auto链接
检测物理接口是否已auto链接
This commit is contained in:
parent
c2caaff559
commit
695fb81893
1 changed files with 6 additions and 0 deletions
|
@ -310,6 +310,12 @@ if [[ $dmidecode_output == *"Hetzner_vServer"* ]] || [[ $dmidecode_output == *"M
|
|||
chattr +i /etc/network/interfaces
|
||||
fi
|
||||
fi
|
||||
# 检测物理接口是否已auto链接
|
||||
if ! grep -q "auto ${interface}" /etc/network/interfaces; then
|
||||
chattr -i /etc/network/interfaces
|
||||
echo "auto ${interface}" >> /etc/network/interfaces
|
||||
chattr +i /etc/network/interfaces
|
||||
fi
|
||||
# 反加载
|
||||
if [[ -f "/etc/network/interfaces.new" && -f "/etc/network/interfaces" ]]; then
|
||||
chattr -i /etc/network/interfaces.new
|
||||
|
|
Loading…
Reference in a new issue