Constant Ping Menubar App

Discussion in 'Mac Programming' started by Haqq, Oct 8, 2010.

  1. macrumors member

    Joined:
    Sep 5, 2008
    Location:
    Toronto
    #1
    This may seem like a very bizzarre question but.

    My macbook and 2wire router/modem hate each other. I get constant timeouts! But I found a workaround (cred: apple.com boards) if I open up terminal ping my router ip 192.186.x.x and it just constantly pings I DO NOT disconnect. I put it under test left; my macbook on for a week straight no problemo!

    Thus coming to my request. I hate having a terminal window open seeing nothing but

    Code:
    64 bytes from 192.168.x.x: icmp_seq=1346 ttl=255 time=1.335 ms
    64 bytes from 192.168.x.x: icmp_seq=1347 ttl=255 time=2.090 ms
    64 bytes from 192.168.x.x: icmp_seq=1348 ttl=255 time=1.375 ms
    
    Its fugly.

    I was hoping someone has heard of a menubar app I can run that just does it in the background? TBH I have very LIMITED programming knowledge so I am not sure where to go here but something like this vimeo but when I click on it, opens up a terminal page of the pinging in action?

    Where do I from here?

    Thanks!

    Taz.
     
  2. macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #2
    This is for linux but it should work for Mac OSX.

    http://www.watchingthenet.com/ubunt...in-the-background-from-a-terminal-window.html
     
  3. thread starter macrumors member

    Joined:
    Sep 5, 2008
    Location:
    Toronto
    #3
  4. macrumors 603

    MorphingDragon

    Joined:
    Mar 27, 2009
    Location:
    The World Inbetween
    #4
    Code:
    nohup ping 192.168.x.x &
    You can check that its running in the background by looking at activity monitor and looking for ping.

    If for any reason you need to stop it, use activity monitor. I'm not sure if this command lives through a reboot or not.
     
  5. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #5
    Alternative solution:

    Open the Apple Script Editor and paste this into it

    Code:
    repeat
    	do shell script "ping -c 1 192.168.0.1 > /dev/null"
    	do shell script "/bin/sleep 60"
    end repeat
    
    Save it as an application. Obviously alter the IP address to the correct one and alter the 60 to the number of seconds you want between pings. The only bad thing about this is that the only way to stop it is to force quit it...
     
  6. thread starter macrumors member

    Joined:
    Sep 5, 2008
    Location:
    Toronto
    #6
    Perfect both methods work! I went with method one btw.
     

Share This Page