diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-03-31 14:11:47 -0500 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-03-31 14:11:47 -0500 |
commit | 4cf00a89810cd529cceb5920a28dfa0198c57b6c (patch) | |
tree | 50d60d90fcc6a6ec02f278003aeeffaf6186d1b3 /scripts | |
parent | 2a9dee8129c20a8f8832c00639e1fea7f3764f9f (diff) | |
download | vyatta-op-4cf00a89810cd529cceb5920a28dfa0198c57b6c.tar.gz vyatta-op-4cf00a89810cd529cceb5920a28dfa0198c57b6c.zip |
Clean up 'show interfaces' a bit.
1. Don't show sit0 and gre0 interfaces
These confuse users that don't know why they are there.
2. Reformat the output so that IPv6 addresses no longer cause
formatting problems
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-show-interfaces.pl | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/scripts/vyatta-show-interfaces.pl b/scripts/vyatta-show-interfaces.pl index 6daa2a4..f278ddd 100755 --- a/scripts/vyatta-show-interfaces.pl +++ b/scripts/vyatta-show-interfaces.pl @@ -236,19 +236,24 @@ sub run_show_intf { sub run_show_intf_brief { my @intfs = @_; - my $format = "%-12s %-18s %-11s %-6s %-29s\n"; - printf($format, "Interface","IP Address","State","Link","Description"); + my $format = "%-10s %-11s %-6s %-48s\n"; + my $format2 = "%-1s %-40s\n"; + printf($format, "Interface","State","Link","Description"); + printf($format, "---------","-----","----","-----------"); foreach my $intf (@intfs) { - my @ip_addr = get_ipaddr($intf); - my ($state, $link) = get_state_link($intf); - my $description = get_intf_description($intf); - if (scalar(@ip_addr) == 0) { - printf($format, $intf, "-", $state, $link, $description); - } else { - foreach my $ip (@ip_addr) { - printf($format, $intf, $ip, $state, $link, $description); - } - } + next if ($intf =~ /gre0/); + next if ($intf =~ /sit0/); + my @ip_addr = get_ipaddr($intf); + my ($state, $link) = get_state_link($intf); + my $description = get_intf_description($intf); + if (scalar(@ip_addr) == 0) { + printf($format, $intf, $state, $link, $description); + } else { + printf($format, $intf, $state, $link, $description); + foreach my $ip (@ip_addr) { + printf($format2,'', "$ip"); + } + } } } |