There are devices similar to this: https://amazon.com/MSNSwitch-Internet-Enabled-Remote-Switch/dp/B081TKJJBS
You can program this to reboot one connected device if it is not 'responding' and the two plugs can be staggered to allow one device to connect to a network.
I use these at work to reboot cable modems automatically if the internet drops for more than a minute or so. It saves my techs from having to drive an hour to a branch office only to power cycle a cable modem in the networking closet. It works via ethernet, not WiFi. A little pricey though.
https://www.amazon.com/MSNSwitch-Internet-Enabled-Remote-Switch/dp/B081TKJJBS/
You can use this to possibly automate the turning on of the switch when the batteries are good and or time passes to turn the server outlet on...
There's a lot of smart outlets that just plug in that work with Alexa. Also power strips like
Not sure if OP is not at the modem location or not- if he is then that's the only solution
If he's not there then an IP controlled power solution would be the only option. That would of course take down the modem and any other equipment attached to it (router, switches etc..) but it all should come back once the modem reinitializes.
I've used these in the past: https://www.startech.com/en-us/server-management/pdu02ip and the Middle Atlantic equivalent RLNK-215. Cheaper option might be this: https://www.amazon.com/dp/B081TKJJBS/ref=sspa\_dk\_detail\_2?psc=1&pd\_rd\_i=B081TKJJBS&pd\_rd\_w=29jdU&pf\_rd\_p=b9951ce4-3bd8-4b04-9123-0fda35d6155e&pd\_rd\_wg=3ygd9&pf\_rd\_r=JP9KP48MXFCKZVMFV8SA&pd\_rd\_r=c9ef425b-3fe4-...
The IoT world is FULL of cheap remote control outlets.
Then there are:
to things like this:
https://www.amazon.com/Tripp-Lite-Switched-Rack-Mount-PDUMH30HVNET/dp/B0013HY9E2/ref=sr_1_4