by john johnston Sunday, November 27, 2016

pi seems to be up and down today. need to do some sort of monitoring. so thinking of AnyBar and applescript...

on idle

 set turl to "http://pi.johnj.info"

try

  set ping to (do shell script "curl " & turl & " | grep 'pi server'")

   tell application "AnyBar" to set image name to "green"

on error

-- if we get here, failed

  tell application "AnyBar" to set image name to "red"

end try

 return 300 --5 minutes

end idle