mirror of
https://github.com/bin456789/reinstall.git
synced 2026-05-21 05:27:41 +08:00
opensuse: 删除 leap 15.6 和 wicked
This commit is contained in:
@ -170,47 +170,6 @@ GatewayOnLink=yes
|
||||
fi
|
||||
}
|
||||
|
||||
fix_wicked_conf() {
|
||||
# https://github.com/openSUSE/wicked/wiki/FAQ#q-why-wicked-does-not-set-my-default-static-route
|
||||
|
||||
# 修改前
|
||||
# default 1.1.1.1 - -
|
||||
# default 2602::1 - -
|
||||
|
||||
# 修改后
|
||||
# 1.1.1.1 - -
|
||||
# 2602::1 - -
|
||||
# default 1.1.1.1 - -
|
||||
# default 2602::1 - -
|
||||
|
||||
if ! confs=$(ls "$os_dir/etc/sysconfig/network/ifroute-"* 2>/dev/null); then
|
||||
return
|
||||
fi
|
||||
|
||||
for conf in $confs; do
|
||||
# 判断 bug 是否已经修复
|
||||
if grep -v 'default' "$conf" | grep -q '-'; then
|
||||
return
|
||||
fi
|
||||
|
||||
# 获取网关
|
||||
gateways=$(awk '$1=="default" {print $2}' "$conf")
|
||||
if [ -z "$gateways" ]; then
|
||||
return
|
||||
fi
|
||||
|
||||
# 创建新条目
|
||||
for gateway in $gateways; do
|
||||
echo "$gateway - -"
|
||||
done | insert_into_file "$conf" head
|
||||
done
|
||||
|
||||
# 重新应用配置
|
||||
if systemctl -q is-enabled wicked; then
|
||||
systemctl restart wicked
|
||||
fi
|
||||
}
|
||||
|
||||
# ubuntu 18.04 cloud-init 版本 23.1.2,因此不用处理
|
||||
|
||||
# debian 10/11 云镜像原本用 ifupdown + resolvconf,脚本改成用 netplan + networkd/resolved
|
||||
@ -224,6 +183,3 @@ fix_netplan_conf
|
||||
# 只需对云镜像处理
|
||||
# 因为普通安装用的是 alpine 的 cloud-init,版本够新,不用处理
|
||||
fix_networkd_conf
|
||||
|
||||
# opensuse 15.5: ifcfg + netconfig (dns) + wicked
|
||||
fix_wicked_conf
|
||||
|
||||
Reference in New Issue
Block a user