Not sure if this is what people are looking for, but the following Perl code allows me to remotely reboot multiple routers at once.
I hope this helps.
PS : Manuel Kasper was kind enough to help me debug my poor Perl code...
#!/usr/bin/perl
use LWP::UserAgent;
my $m0n0wall_user = "admin";
my $m0n0wall_pass = "mono";
foreach my $m0n0wall_ip ('192.168.2.254', '192.168.3.254', '192.168.4.254', '192.168.1.254',)
{
my $ua = LWP::UserAgent->new;
$ua->credentials("$m0n0wall_ip:80", ".", $m0n0wall_user, $m0n0wall_pass);
my $res = $ua->get("http://$m0n0wall_ip/reboot.php");
my @content = split(/\n/, $res->content);
my $csrftoken;
for (@content) {
if ( m/"(sid:.+?)"/ ) {
$csrftoken = $1;
}
}
$res = $ua->post("http://$m0n0wall_ip/reboot.php", {
'__csrf_magic' => $csrftoken,
'Submit' => " Yes "
});
sleep(1);
}
# EOF