|
@@ -103,7 +103,7 @@ fi
|
|
|
ip -o link show | awk -F': ' '{print $2}' | while read interface; do
|
|
|
# 处理192.168.3网段的网卡
|
|
|
mac=$(ip link show dev "$interface" | awk '/link\/ether/ {print $2}')
|
|
|
- ip=$(ip addr show dev "$interface" | awk '/inet 192.168.6/ {print $2}')
|
|
|
+ ip=$(ip addr show dev "$interface" | awk '/inet (192\.168\.(3|6))/ {print $2}')
|
|
|
if [ -n "$ip" ] && [ -n "$mac" ]; then
|
|
|
subnet=$(echo "$ip" | awk -F'/' '{print $1}' | awk -F'.' '{print $1"."$2"."$3}')
|
|
|
echo "网卡名称: $interface,MAC地址: $mac,IP地址: $(echo $ip | cut -d '/' -f 1), subnet: $subnet"
|