core: 在 windows 下找到 ip 时才获取网关
This commit is contained in:
parent
1b9069272d
commit
8dfdce23e3
@ -808,9 +808,9 @@ collect_netconf() {
|
||||
# 网关
|
||||
# shellcheck disable=SC2154
|
||||
for gateway in "${gateways[@]}"; do
|
||||
if [[ "$gateway" = *.* ]]; then
|
||||
if [ -n "$ipv4_addr" ] && [[ "$gateway" = *.* ]]; then
|
||||
ipv4_gateway="$gateway"
|
||||
elif [[ "$gateway" = *:* ]]; then
|
||||
elif [ -n "$ipv6_addr" ] && [[ "$gateway" = *:* ]]; then
|
||||
ipv6_gateway="$gateway"
|
||||
fi
|
||||
done
|
||||
|
Loading…
Reference in New Issue
Block a user