Script for mass reboot

Hi I’m looking into incorporating a mass reboot script into some of my networks. I’d like some help on it as I only have the idea of how to do it.

------Idea-------
I’m looking for a way to have a script running always in the background that listens for a specific key incoming from one of the ports (E2 for most) and when that’s heard it restarts the router. That key would be forwarded from the “Master” Station (currently the 1st router after the modem), on prespecified addresses (only the routers, or a specific batch of them later on). I know I’m probably going the wrong way about this, but I need it fully customisable for future use.

------Problem-------
Now the actual problem. I couldn’t find any commands (without the use of a computer) that push message to a specific address or a command that listens on it. So I’m looking for a script for this. Pretty much a multicast command that triggers the listening routers to reboot. Haven’t started working on it, I’m still in the research part and just wondering if I’m going about it wrong.
Thanks

Why? Reboot should not be needed.

It’s not only for a reboot. If it works, A) i can order a reboot on every router remotely at once (via cloud service) B) it can be made to do other, more complex things in due time.

The idea came from one of the hotels coming across a sync error which rebooting every router fixed the issue. No idea why, or how, but never came up again. If I can put this script on every hotel i manage it can be easily triggered, easily modified for any need and can cut down the downtimes due to maintenance