5

Network Status by @nbrito

Posted in Internet by nbrito 2740 days ago

This Geeklet allows users to check the network status for:

  1. Ethernet connection (en0);
  2. Wireless connection (en1); and
  3. Personal Hotspot connection (iPhone - en2).

This is a simple script, which allows users to see whether the network interface is disconnected, has a IP address assigned and/or is unavailable, using the following shell script:

case `ifconfig enX | grep status | awk -F": " '{ print $2 }'` in
   active) echo `ifconfig enX | grep "inet" | grep -v 127.0.0.1 | grep -v inet6 | awk '{print $2}'`;;
   inactive) echo "\033[1;31mDisconnected\033[0m";;
   *) echo "\033[1;31mUnavailable\033[0m";;
esac

Hope this can increment your GeekTool experience!

Regards, Nelson Brito


Comments

User Avatar
GYLLIWER 2676 days ago
Tell to me please, in what format the file is written down, and than its can be governed?
User Avatar
mahclark 2631 days ago
:)

Log in to comment or register here.