From 0abbeb7085402fe752d8aaec1442e7c78123f28e Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sun, 12 Nov 2023 22:14:56 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E8=A7=84=E8=8C=83=E5=8C=96=E4=BA=91?= =?UTF-8?q?=E9=95=9C=E5=83=8F=E9=9D=99=E6=80=81=20ipv6=20=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/trans.sh b/trans.sh index 12fe432..6494844 100644 --- a/trans.sh +++ b/trans.sh @@ -876,9 +876,15 @@ create_cloud_init_network_config() { get_netconf_to ipv6_gateway # centos7 不认识 static6,但可改成 static,作用相同 # https://github.com/canonical/cloud-init/commit/dacdd30080bd8183d1f1c1dc9dbcbc8448301529 + if [ -f /os/etc/system-release-cpe ] && + grep centos:7 /os/etc/system-release-cpe; then + type_ipv6_static=static + else + type_ipv6_static=static6 + fi yq -i " .network.config[0].subnets += [{ - \"type\": \"static\", + \"type\": \"$type_ipv6_static\", \"address\": \"$ipv6_addr\", \"gateway\": \"$ipv6_gateway\" }] " $ci_file