This uses a shell script to list the IP addresses of en0 (ethernet) and en1 (AirPort). For AirPort, if the system is connected to a network, it will list the SSID and channel connected.
The needed shell script (thanks to Appi for the suggestion about the PrivateFramework!) is here - the lines that start with myvar1 and myvar2 should each be on one line one below the next:
#! /bin/bash
myen0=`ifconfig en0 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`
if [ "$myen0" != "" ]
then
echo "Ethernet : IP - $myen0"
else
echo "Ethernet : INACTIVE"
fi
myen1=`ifconfig en1 | grep "inet " | grep -v 127.0.0.1 | awk '{print $2}'`
if [ "$myen1" != "" ]
then
myvar1=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | grep -e "SSID:" | tail -n 1 | awk '{print $2}'`
myvar2=`/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | grep -e "channel:" | awk '{print $2}'`
echo "AirPort : IP - $myen1
Network - $myvar1
Channel - $myvar2"
else
echo "Airport : INACTIVE"
fi
IP Information
Posted in System by Khelmar 84 days agoGeeklet file(s) to download
ipaddresses.gletEither right-click and choose "Save Linked File As..." or hold the Option key and click to download files.
If using Safari, you may have to rename the files without the extra .txt extension that is added.
Geeklets are little bits of text, images or information that you can display on your desktop using the free GeekTool software.
Read more...
Read more...
Advertisement


Comments