//Random Tip
Latest tips by RSS
Click here to subscribe
Follow Shell-Fu on Twitter
Click here to follow
Follow Shell-Fu on identi.ca
Click here to follow

You are viewing a random entry, refresh your browser to change.

This script will run check a for the Ubuntu 9.10 launch once every 5 mins and let you know when it's available:

while [ 1 ]; do if [ -z "`curl -I "http://cdimage.ubuntu.com/releases/9.10/release/"|grep "404"`" ];
then kdialog --msgbox "9.10 Released"; exit; fi; sleep 300;  done


View Comments »



Comments 

Add your comment

Comments are currently disabled
Andrew McCombe
Or, for Gnome users that don't have kdialog installed:

while [ 1 ]; do if [ -z "`curl -I "http://cdimage.ubuntu.com/rele … ease/";|grep "404"`" ];
then zenity --warning --text "9.10 Released"; exit; fi; sleep 300;  done
Posted 2009-10-29 04:29:22
Better to search for a positive, than to exclude one specific negative. 404 isn't the only error. The server could be down!!

while [ 1 ];
 do if [ ! -z "`curl -I "http://cdimage.ubuntu.com/rele … ease/";|grep "HTTP/1.1 200 OK"`" ];
 then
   zenity --warning --text "9.10 Released"
   exit;
 fi;
 sleep 300;
done
Posted 2009-10-29 04:58:21
One of the worst tips ever.

cron was made for exactly that...
Posted 2009-10-29 05:30:58
Dave Grime
Martin:

Surely cron was made for recurring tasks with no end condition? I would have said this is exactly what 'while' was made for!
Posted 2009-10-29 08:53:09
Andrew
You could do the same thing by grepping the slashdot homepage.
Posted 2009-10-29 08:59:27

Home Latest Browse Top 25 Random Hall Of Fame Contact Submit