Skip to content

Commit de0d341

Browse files
committed
Fixes in OSX system module's network interface getter.
1 parent 7c83960 commit de0d341

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

system/platform/mac/functions

100644100755
+3-3
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,12 @@ get_ioreg_vendor_and_model(){
5959

6060
get_network_interfaces(){
6161

62-
local nic_list=$(networksetup -listnetworkserviceorder 2> /dev/null | grep -v Bluetooth | grep Hardware)
62+
local nic_list=$(networksetup -listnetworkserviceorder 2> /dev/null | grep -v Bluetooth | grep -v DataTransfer | grep -v usbmodem | grep Hardware)
6363

6464
while read line; do
6565

6666
local human_name=$(echo "$line" | cut -d',' -f1 | awk -F ': ' '{print $2}')
67-
local name=$(echo "$line" | sed "s/.* \(.*\))$/\1/")
67+
local name=$(echo "$line" | sed "s/.* \(.*\))$/\1/" | sed "s/([^a-z\-]*)//g")
6868

6969
if [[ "$human_name" =~ "Ethernet" ]]; then
7070

@@ -76,7 +76,7 @@ get_network_interfaces(){
7676
local model=$(echo "$output" | cut -d";" -f2)
7777
done <<< "$model_and_vendor"
7878

79-
elif [[ "$human_name" =~ "AirPort" ]]; then
79+
elif [[ "$human_name" =~ "AirPort" || "$human_name" =~ "Wi-Fi" ]]; then
8080

8181
local interface_type="Wireless"
8282
local model_and_vendor=$(get_ioreg_vendor_and_model "802.11" | tr "\n" ";")

system/version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.2
1+
3.3

0 commit comments

Comments
 (0)