#!/bin/bash
MODEM=192.168.100.1  # add an alias so you can get to this
GATEWAY=68.12.144.1  # flavor to suit
if ! ping -q -c 1 -w 5 $GATEWAY > /dev/null; then
  echo -n 'BUTTON_INPUT=Restart%20Cable%20Modem' |
    POST -d http://$MODEM/configdata.html
  echo -n 'cable modem restarted at '
  date
fi
