Websites Online/Offline

Posted in Internet by alanc 2770 days ago

A quick and dirty approach to checking and displaying the status of a website. Be aware this method isn't perfect and shouldn't be used in a mission critical environment.


  1. Add or remove domains from the $servers array as you need.

  2. I colored the ONLINE text green and the OFFLINE text red. This will override any font color settings in GeekTool.

Note that the use of colors also causes a reset of the text color to the default color after the first domain. In other words, if you have styled your text blue you will see:

(blue)domain is (green)ONLINE (white)domain is (green)ONLINE (white)domain is (red)OFFLINE

and so on. To ensure that you see:

(blue)domain is (green)ONLINE (blue)domain is (green)ONLINE (blue)domain is (red)OFFLINE

you need to modify '\033[0;254;176;19m' to reflect your desired color. This is simple and easy as you just follow the form: '\033[0;RRR;GGG;BBBm' where RRR, GGG, BBB represent the numeric values of your desired text color.

If you are using un-colored text, this is of no concern and you should just remove all of the '\033[0;254;176;19m' color parts.

Geeklet files to download


User Avatar
alanc 2770 days ago
1/19/2012 21:11EST (GMT -5:00) Re-uploaded the script file as it was missing '0;' in the red color formatting.

Log in to comment or register here.