Thank you kindlar, you have solved my problem. The script in sonoff is a timer that can be programmed remotely (as long as the internet->router->sonoff connection is still running, but the router has hung up and you can't access it with ssh/www). The smallest time slot is 1 minute. I set a timer in Ewelink in the smartphone app for 1 minute - off and immediately below it for 2 minutes on. In sonoff, I have permanently set the status when the power is switched off - always on. Sonoff internally saves the settings of the timer scenario you wrote about and it can even be disconnected from the internet, it will automatically restart the router and without a wifi connection it will switch on the power after 2 minutes to the router.
The second way seems to be the best, leaving a second phone at home with an active SIM and GSM/3G/4G connection with a wifi hotspot to which the sonoff is connected (and not under the wifi router). If the internet connection in the router fails, the sonoff will restart via the backup connection on the phone. Perhaps a third way, but an unreliable one, would be to insert a GSM modem on the USB port of the router with an active SIM card and to set the router so that it switches to Internet transmission via the GSM modem if the fibre connection fails, which is unlikely. If the router crashes completely, this is of no use to me as a third way.
Just in case, I have also set the router in the administration panel to restart automatically every 6 hours (non-original firmware Padavan on my router allows access to a crontab where I set what is to be done and when at what time.
Click helped.