Geektool internet on/of image

166 views Asked by At

Trying to display an image when I am connected to the internet and another when I am not, I managed to come up with this 2 geeklet system:

1 shell:

if curl -f -s http://google.com > /dev/null ; then cp      /Users/mike/Documents/net.png /tmp/connstatus.png ; /Users/mike/Documents/noNet.png /tmp/connstatus.png ; fi ;

2 Image: pointing to /tmp/connstatus.png

It does not work. Thanks in andvace

1

There are 1 answers

4
baf On BEST ANSWER

You are missing else statement in your if:

if curl -f -s http://google.com > /dev/null
then 
  cp /Users/mike/Documents/net.png /tmp/connstatus.png
else
  cp /Users/mike/Documents/noNet.png /tmp/connstatus.png
fi