From ff57f6a136e606b5ca0baf0ea91d7681b926955f Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sat, 23 Dec 2023 20:32:32 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E9=80=9A=E8=BF=87=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E7=BD=91=E5=85=B3=E6=89=BE=E5=88=B0=E7=BD=91=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- reinstall.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/reinstall.sh b/reinstall.sh index aaa2770..24a40f4 100644 --- a/reinstall.sh +++ b/reinstall.sh @@ -848,10 +848,18 @@ collect_netconf() { # 部分机器精简了 powershell # 所以不要用 powershell 获取网络信息 - ids=$(wmic nic where "PhysicalAdapter=true and MACAddress is not null and (PNPDeviceID like '%VEN_%&DEV_%' or PNPDeviceID like '%{F8615163-DF3E-46C5-913F-F2D2F965ED0E}%')" get InterfaceIndex | del_cr | sed '1d') + # ids=$(wmic nic where "PhysicalAdapter=true and MACAddress is not null and (PNPDeviceID like '%VEN_%&DEV_%' or PNPDeviceID like '%{F8615163-DF3E-46C5-913F-F2D2F965ED0E}%')" get InterfaceIndex | del_cr | sed '1d') + + # 否 手动 0 0.0.0.0/0 19 192.168.1.1 + # 否 手动 0 0.0.0.0/0 59 nekoray-tun + ids=" + $(netsh int ipv4 show route | grep --text -F '0.0.0.0/0' | awk '$6 ~ /\./ {print $5}') + $(netsh int ipv6 show route | grep --text -F '::/0' | awk '$6 ~ /:/ {print $5}') + " + ids=$(echo "$ids" | sort -u) for id in $ids; do config=$(wmic nicconfig where "InterfaceIndex='$id'" get MACAddress,IPAddress,IPSubnet,DefaultIPGateway /format:list | del_cr) - # 排除 IP/子网/网关为空的 + # 排除 IP/子网/网关/MAC 为空的 if grep -q '=$' <<<"$config"; then continue fi