Fix write_systemd_networkd_bootproto()

Logic in this function was inverted (but it worked anyway).
See ALT bug #49159.
This commit is contained in:
Mikhail Efremov 2024-01-23 21:11:06 +03:00
parent 2bfe206027
commit ce806a065e

View File

@ -1170,21 +1170,21 @@ write_systemd_networkd_bootproto()
ipv6_gateway="$(read_iface_default_gw "$cachedir" 6)" ipv6_gateway="$(read_iface_default_gw "$cachedir" 6)"
fi fi
first_value_flag= first_value_flag=1
for addr in $ipv4_addresses $ipv6_addresses; do for addr in $ipv4_addresses $ipv6_addresses; do
if [ -n "$first_value_flag" ]; then if [ -n "$first_value_flag" ]; then
write_systemd_networkd_ini_option "$network_filename" "Network" "Address" "$addr" write_systemd_networkd_ini_option "$network_filename" "Network" "Address" "$addr"
first_value_flag=1 first_value_flag=
else else
add_systemd_networkd_ini_option "$network_filename" "Network" "Address" "$addr" add_systemd_networkd_ini_option "$network_filename" "Network" "Address" "$addr"
fi fi
done done
first_value_flag= first_value_flag=1
for gw in $ipv4_gateway $ipv6_gateway; do for gw in $ipv4_gateway $ipv6_gateway; do
if [ -n "$first_value_flag" ]; then if [ -n "$first_value_flag" ]; then
write_systemd_networkd_ini_option "$network_filename" "Network" "Gateway" "$gw" write_systemd_networkd_ini_option "$network_filename" "Network" "Gateway" "$gw"
first_value_flag=1 first_value_flag=
else else
add_systemd_networkd_ini_option "$network_filename" "Network" "Gateway" "$gw" add_systemd_networkd_ini_option "$network_filename" "Network" "Gateway" "$gw"
fi fi