This uses a shell script to list your public facing IP addresses, as well as en0 (ethernet) and en1 (AirPort). For AirPort, if the system is connected to a network, it will also list the SSID.
The needed shell script is here:
#!/usr/bin/perl
# a little script to get your network status
$en0_info = `ifconfig en0 | grep "inet" | grep -v 127.0.0.1`;
$en1_info = `ifconfig en1 | grep "inet" | grep -v 127.0.0.1`;
$ext_info = `curl --silent http://checkip.dyndns.org | awk '{printf $6}' | cut -f 1 -d "<" | tr -d 'n'`;
$airport_network = `/System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Resources/airport -I | awk -F: '/ SSID/ {print $2}'`;
if($ext_info)
{
$output .= "External: $ext_info ";
}
else
{ $output .= "External: OFFLINE ";}
if($en0_info)
{
$en0_info =~ /inet (.*) netmask/s;
$output .= "Ethernet: $1 ";
}
else
{ $output .= "Ethernet: INACTIVE ";}
if($en1_info)
{
$en1_info =~ /inet (.*) netmask/s;
$en1_info = $1;
$output .= "Airport: $en1_info SSID: $airport_network ";
}
else
{ $output .= "Airport: INACTIVE ";}
print "$output";
IP Status (Public IP, LAN IP, WAN IP, SSID Name)
Posted in System by realityloop 65 days agoGeeklet file(s) to download
IP-Status.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
Advertise Here


Comments
40 days ago
9 days ago
Joes-MBP:~ jkcolo22$ /Users/jkcolo22/scripts/IP-status.glet
/Users/jkcolo22/scripts/IP-status.glet: line 1: syntax error near unexpected token `newline'
/Users/jkcolo22/scripts/IP-status.glet: line 1: `'