Final Thoughts

Hey, how do I know this is working? Good question.

Open wemoswitch.sh and change the variable PINGTARGET to an ip address that is not live. You could use "8.8.8.9" for example. Save your changes and either wait up to 15 minutes for cron to run the script again, or just run it yourself from the command line:

[abauer@localhost bin]$ ./wemoswitch.sh

No reply from 8.8.8.9
Charter is at it again!
Cycling Power on the Cable Modem
Watch the power cycle on your cable modem. Don't forget to change the PINGTARGET variable back to a valid ip address!

Since this script runs via cron, you normally won't directly see the output above. Instead, many distros will capture the output of any cron script and send it as an email to the local root user account.  On my own system, I've remapped this to go to my own user account.