core: 修复用了 subshell 导致 ra 信息没有缓存

This commit is contained in:
bin456789 2023-10-22 17:22:13 +08:00
parent 026b11ba22
commit a567ec1e4c
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -719,7 +719,7 @@ create_cloud_init_network_config() {
# shellcheck disable=SC2154
is_dhcpv4 && dhcp4=true || dhcp4=false
(is_dhcpv6 || is_slaac) && dhcp6=true || dhcp6=false
{ is_dhcpv6 || is_slaac; } && dhcp6=true || dhcp6=false
cat <<EOF >>$ci_file
network:
version: 2
@ -756,7 +756,7 @@ EOF
if ! is_dhcpv4; then
dns4_list=$(echo "$dns_list" | grep '\.' || true)
fi
if ! (is_slaac || is_dhcpv6); then
if ! { is_slaac || is_dhcpv6; }; then
dns6_list=$(echo "$dns_list" | grep ':' || true)
fi