Created
August 6, 2015 17:53
-
-
Save packetchef/c3f9764bb4a326626df0 to your computer and use it in GitHub Desktop.
For OS X: show details for all network interfaces
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
oldIFS=$IFS | |
IFS=' | |
' | |
NETWORKSETUP=$(whereis networksetup) | |
NETWORKSERVICES=$($NETWORKSETUP -listallnetworkservices | grep -v '^An asterisk') | |
for service in $NETWORKSERVICES | |
do | |
echo "Service config for $service" | |
$NETWORKSETUP -getinfo "$service" | |
echo "******" | |
done | |
IFS=$oldIFS | |
Example output: | |
****** | |
Service config for Display Ethernet | |
DHCP Configuration | |
Client ID: | |
IPv6: Automatic | |
IPv6 IP address: none | |
IPv6 Router: none | |
Ethernet Address: ac:ac:ac:ac:ac:ac | |
****** | |
Service config for Wi-Fi | |
DHCP Configuration | |
IP address: 10.10.10.10 | |
Subnet mask: 255.255.0.0 | |
Router: 10.10.10.254 | |
Client ID: | |
IPv6: Automatic | |
IPv6 IP address: none | |
IPv6 Router: none | |
Wi-Fi ID: 60:60:60:60:60:60 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment