I am using the following to create an EA to return the Mac address of the Ethernet adapters but the field is blank. Any ideas as to what might be the cause?
!/bin/sh
USBMAC=$(networksetup -listallhardwareports | awk '/Hardware Port: USB /{getline; getline; print $NF}')
if [[ "$USBMAC" == "" ]]; then
echo "<result>N/A</result>"
else
echo "<result>$USBmac</result>"
fi
When I run networksetup -listallhardwareports | awk '/Hardware Port: USB /{getline; getline; print $NF}' directly on the Mac in question it does return the MAC address of the adapter.