This is great, thanks!
I might extend it to restart my router if there is no external/internet connection