Will this work? (Reboot modem)

Nice script. You could also do the same thing a Sonoff wifi switch (if you don’t have this particular modem). The URL is similar “http://192.168.100.1/reboot”. Looks like you would only need to change the wget url in the script to the different url.