I wrote a software that detects internet connectivity and if internet connection is down restarts your router by unplugging it from the electricity and plugging it back in (using Tellstick and a regular receiver connected to the router).
More information and source code will follow in the future...