lu.se

Datavetenskap

Lunds Tekniska Högskola

Denna sida på svenska This page in English

network_info.sh

network_info.sh resides on GitHub: https://github.com/Peter-Moller/network-info

på svenska

About the script

The script network_info.sh shows information about the computers network configuration. Both active and inactive network interfaces are listed, in the order that they are used by the OS and with a lot of details (MAC-address, interface name, router, subnet mask etc.).

With the aid of GeekTool (not included) the result can be displayed on the desktop as in these pictures (click for larger image):

Color key:

green text Interfacet is active
back text Inactive interface
white text Disabled interface

Getting the script

The script does not need to be “installed” and does not have any components that is run by cron or launchd. It's just to get it, set the access right and run:

  1. Get the script from
    http://fileadmin.cs.lth.se/cs/Personal/Peter_Moller/scripts/network_info.sh 
  2. Start Terminal.app
  3. Set access rights:
    chmod 755 network_info.sh (it's most probably in your Downloads folder)
  4. Put it where you want, either in $PATH or you will have to run it with an absolute PATH

sha1-checksum for network_info.sh:

GeekTool

The script can be run from Termninal.app, but for those who want to use GeekTool and have the output of the script on the monitor, here's a short guide:

  1. If you don't already have GeekTool, get it here: http://projects.tynsoe.org/en/geektool/
  2. In GeekTool: click the icon named “Shell” and drag it to the desktop. Then make it as large as you want and position it where you want.
  3. In the “Properties” window, fill in this:
    • Command: network_info.sh (and it's PATH unless you put it in $PATH)
    • Refresh every: 120 s (or how often you like to update the information)
    • Change typeface to a monospace font (I use Menlo and white color)
  4. Now you can close GeekTool

Please note that GeekTool doesn't move things around if you change the display setup (such as adding or disconnecting monitors)!

Updates

Every now and then, I do changes/enhancements/bugfixes in my script. You update the script by writing the following in Terminal.app:
network_info.sh -u
(Depending on where you saved the script, you may need to become root to update!)

This will fetch the latest version of the script and replace the old version (if different – otherwise it will tell you).

Alternatively, you may get the script manually again!