mirror of
https://github.com/thelittlerocket/pve.git
synced 2025-01-31 18:18:28 +08:00
Update
This commit is contained in:
parent
f3490293ec
commit
44f6d55774
1 changed files with 17 additions and 6 deletions
|
@ -103,12 +103,6 @@ if [[ -f "/etc/network/interfaces.new" && -f "/etc/network/interfaces" ]]; then
|
|||
cp -f /etc/network/interfaces.new /etc/network/interfaces
|
||||
chattr +i /etc/network/interfaces
|
||||
fi
|
||||
chattr -i /etc/network/interfaces
|
||||
sed -i '/source \/etc\/network\/interfaces\.d\/*/{s/^/#/}' "/etc/network/interfaces"
|
||||
chattr +i /etc/network/interfaces
|
||||
chattr -i /etc/network/interfaces.new
|
||||
sed -i '/source \/etc\/network\/interfaces\.d\/*/{s/^/#/}' "/etc/network/interfaces.new"
|
||||
chattr +i /etc/network/interfaces.new
|
||||
# 合并文件
|
||||
if [[ -f "/etc/network/interfaces.d/50-cloud-init" && -f "/etc/network/interfaces" ]]; then
|
||||
if [[ ! -f "/etc/network/interfaces" ]]; then
|
||||
|
@ -119,6 +113,23 @@ if [[ -f "/etc/network/interfaces.d/50-cloud-init" && -f "/etc/network/interface
|
|||
rm /etc/network/interfaces.d/50-cloud-init
|
||||
chattr +i /etc/network/interfaces
|
||||
fi
|
||||
# 去除引用
|
||||
if [[ -f "/etc/network/interfaces" ]]; then
|
||||
chattr -i /etc/network/interfaces
|
||||
sed -i '/source \/etc\/network\/interfaces\.d\/*/{s/^/#/}' "/etc/network/interfaces"
|
||||
chattr +i /etc/network/interfaces
|
||||
fi
|
||||
if [[ -f "/etc/network/interfaces.new" ]]; then
|
||||
chattr -i /etc/network/interfaces.new
|
||||
sed -i '/source \/etc\/network\/interfaces\.d\/*/{s/^/#/}' "/etc/network/interfaces.new"
|
||||
chattr +i /etc/network/interfaces.new
|
||||
fi
|
||||
# 反加载
|
||||
if [[ -f "/etc/network/interfaces.new" && -f "/etc/network/interfaces" ]]; then
|
||||
chattr -i /etc/network/interfaces
|
||||
cp -f /etc/network/interfaces /etc/network/interfaces.new
|
||||
chattr +i /etc/network/interfaces
|
||||
fi
|
||||
# 允许手动配置
|
||||
# if ! grep -q "iface ${interface} inet manual" "/etc/network/interfaces"; then
|
||||
# chattr -i /etc/network/interfaces
|
||||
|
|
Loading…
Reference in a new issue