I made this because the modem at my house disconnects constantly. Typically what I would do was walk to the other side of the house to turn the modem off and on again or log in to the modem via a browser and reconnect from there.
I got tired of doing that so I made this do to it for me. It's a small script that logs into the modem ui and checks if it's still connected to the internet. If not it reconnects for me.
Here it is in action: