Commit 1510a838 authored by Jondy Zhao's avatar Jondy Zhao

Fix no guid of network connection in the Windows 7

parent 007fb44a
......@@ -308,8 +308,13 @@ function format_interface_name()
if ! [[ "${guid:0:1}" == "{" ]] ; then
echo $1
else
ipv6 if | grep -B1 "${guid}" | \
sed -e "2d" -e "s/^Interface[0-9: ]\+\(Ethernet: \)\?//g"
which ipv6 > /dev/null 2>&1
if (( $? )) ; then
getmac /fo list /v | grep -B3 "^Transport Name:.*$guid" | grep "^Connection Name:" | sed -e "s/^Connection Name: *//g"
else
ipv6 if | grep -B1 "${guid}" | \
sed -e "2d" -e "s/^Interface[0-9: ]\+\(Ethernet: \)\?//g"
fi
fi
}
......
......@@ -73,9 +73,8 @@ function reset_connection()
function connection2guid()
{
ifname=${1-re6stnet-lo}
netsh interface ipv6 show interface $ifname | \
grep "^GUID\s*:" | \
sed -e "s/^GUID\s*:\s*//"
getmac /fo list /v | grep -A3 "^Connection Name: *$ifname\$" \
| grep "^Transport Name:" | sed -e "s/^.*Tcpip_//g"
}
#
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment