If you have a Surfboard cable modem, you may or may not know that it has a virtual web server on 192.168.100.1 (basically if you try to pass traffic through on that IP address it intercepts and answers it) which allows you to get status.
It also has a page with "reset modem" and "reset to defaults" buttons. Now, it's malformed, but that's beside the point. Editing the HTML and using a browser on it allows you to reset the modem.
Lately I've had my model be "up" but my router unable to get a lease a handful of times. Powercycling fixes it. I don't want to play with X10 so I mashed together this perl script, which does an HTTP POST without using LWP. It does reset but I don't know if it makes the problem go away yet.
I need a first hop router ping test to wrap it in and then cron will run it.
I can't take credit for all of it. I found a script online somewhere which did an HTTP POST without use of LWP, but it didn't work. I rewrote until it did.
Attachments
171125-resetmodem.pl (146 downloads)