diff --git a/scripts/starts/fw_getlanip.sh b/scripts/starts/fw_getlanip.sh index aeaccc16..b66f357b 100644 --- a/scripts/starts/fw_getlanip.sh +++ b/scripts/starts/fw_getlanip.sh @@ -2,7 +2,7 @@ getlanip() { #获取局域网host地址 i=1 while [ "$i" -le "20" ]; do - host_ipv4=$(ip route show scope link | grep -Ev 'wan|utun|iot|peer|docker|podman|virbr|vnet|ovs|vmbr|veth|vmnic|vboxnet|lxcbr|xenbr|vEthernet' | awk '{print $1}' | tr '\n' ' ' | sed 's/ $//') #ipv4局域网网段 + host_ipv4=$(ip route show scope link | grep -Ev 'wan|utun|iot|peer|docker|podman|virbr|vnet|ovs|vmbr|veth|vmnic|vboxnet|lxcbr|xenbr|vEthernet' | awk '{print $1}') #ipv4局域网网段 [ "$ipv6_redir" = "ON" ] && host_ipv6=$(ip -6 route show default | awk '{print $3}' | tr '\n' ' ' | sed 's/ $//') #ipv6公网地址段 [ -f "$TMPDIR"/ShellCrash.log ] && break [ -n "$host_ipv4" -a "$ipv6_redir" != "ON" ] && break @@ -13,7 +13,7 @@ getlanip() { #获取局域网host地址 if [ "$replace_default_host_ipv4" == "ON" ]; then host_ipv4="$cust_host_ipv4" else - host_ipv4="$host_ipv4 $cust_host_ipv4" + host_ipv4=$(echo $host_ipv4 $cust_host_ipv4 | tr '\n' ' ' | sed 's/ $//') fi #缺省配置 [ -z "$host_ipv4" ] && {