Checking and Restarting a Modem

My ISP is less than reliable so I decided to automate my modem restarts. I’m using a Motorola SB6141 and I can access a web based interface at Using a combination of curl, grep, and sed, I was able to scrape the necessary pages to get information about the modem’s status. The script then checks the status and restarts the modem if it detects a fault. The script uses curl to GET a specific URL with the necessary parameters.