mirror of
https://github.com/bin456789/reinstall.git
synced 2025-01-19 12:49:14 +08:00
core: 云镜像配置文件,将dns单行数组换成多行数组,否则centos7/8会报错
This commit is contained in:
parent
55df802f26
commit
b44b8d90ab
17
trans.sh
17
trans.sh
@ -612,7 +612,7 @@ network:
|
|||||||
gateway4: $ipv4_gateway @ipv4_gateway
|
gateway4: $ipv4_gateway @ipv4_gateway
|
||||||
gateway6: $ipv6_gateway @ipv6_gateway
|
gateway6: $ipv6_gateway @ipv6_gateway
|
||||||
nameservers:
|
nameservers:
|
||||||
addresses: [@dns_addrs]
|
addresses: @dns_addrs
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
if is_dhcpv4 || [ -z "$ipv4_addr" ]; then
|
if is_dhcpv4 || [ -z "$ipv4_addr" ]; then
|
||||||
@ -637,20 +637,13 @@ EOF
|
|||||||
dns6_list=$(echo "$dns_list" | grep ':' || true)
|
dns6_list=$(echo "$dns_list" | grep ':' || true)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
unset dns_str
|
is_have_dns=false
|
||||||
is_first=true
|
|
||||||
for cur in $dns4_list $dns6_list; do
|
for cur in $dns4_list $dns6_list; do
|
||||||
if $is_first; then
|
is_have_dns=true
|
||||||
is_first=false
|
echo " - $cur" >>$ci_file
|
||||||
else
|
|
||||||
dns_str="$dns_str, "
|
|
||||||
fi
|
|
||||||
dns_str="$dns_str$cur"
|
|
||||||
done
|
done
|
||||||
|
|
||||||
if [ -n "$dns_str" ]; then
|
if ! $is_have_dns; then
|
||||||
sed -i "s/@dns_addrs/$dns_str/" $ci_file
|
|
||||||
else
|
|
||||||
sed -i '/nameservers:/d' $ci_file
|
sed -i '/nameservers:/d' $ci_file
|
||||||
sed -i '/@dns_addrs/d' $ci_file
|
sed -i '/@dns_addrs/d' $ci_file
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user