How to Reboot a Draytek Router from remote with a perl-script
Probably due a complex setup and a slightly buggy firmware the VPN of my Draytek Vigor Router 2950 stops working from time to time. The only way to make it run again is a reboot.
As a workaround I created a perl-script to reboot the boxen from remote and added the reboot to the crontab of my linux server in the secure zone (telnet, unencrypted!). Now that the Vigor is rebooted every night, the VPN lockups don't occur anymore.
$telnet = new
Net::Telnet ( Timeout=>10, Errmode=>'die',
Host=>'**INSERTYOURHOSTIP**', Port=>'**INSERTPORTFORTELNET**', Prompt=>'/> $/');
print $telnet->cmd('sys reboot');
Of course you need Net::Telnet (from CPAN or your distribution).