#!/usr/bin/perl -w use strict; use WRT54G; use Util; my %config = Util::parse_config('wrt54g.cfg'); my $router = WRT54G->new(%config); my %status = $router->get_status(); foreach my $interface (qw(lan wan inet)){ print("$interface:\n"); foreach my $key (keys %{$status{$interface}}){ if(ref $status{$interface}->{$key} eq "ARRAY"){ print("$key: ", join(", ", @{$status{$interface}->{$key}}), "\n") }else{ print("$key: $status{$interface}->{$key}\n"); } } print("\n"); }