Search code examples
imagemacosconnectionstatusgeektool

Geektool internet on/of image


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


Solution

  • 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