projects
/
APKPM.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18ebd91
)
parse show adsl perl $port
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 27 Nov 2011 18:28:39 +0000
(19:28 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Sun, 27 Nov 2011 18:28:39 +0000
(19:28 +0100)
lib/H1/ZTEDSLAM.pm
patch
|
blob
|
history
diff --git
a/lib/H1/ZTEDSLAM.pm
b/lib/H1/ZTEDSLAM.pm
index
f304345
..
c00a4a7
100644
(file)
--- a/
lib/H1/ZTEDSLAM.pm
+++ b/
lib/H1/ZTEDSLAM.pm
@@
-103,6
+103,22
@@
sub custom {
}
}
+ my $out = $self->command_out("show adsl perf $port");
+ my @lines = split(/\s*[\n\r]+/,$out);
+
+ my $table;
+ foreach my $line ( @lines ) {
+ next if ! $line;
+ if ( $line =~ m/ADSL\s+(\w+)\s+Table/i ) {
+ $table = $1;
+ next;
+ } elsif ( $line =~ m/^(\S+)\s+:\s+(\S)*$/ ) {
+ $hash->{ $table . '_' . $1 } = $2 if defined $2;
+ } else {
+ warn "# IGNORED: $line\n";
+ }
+ }
+
return $hash;
}