From 889f218328589847ec699292863e5b3ed2c936d5 Mon Sep 17 00:00:00 2001 From: John Southworth Date: Tue, 6 Dec 2011 11:43:48 -0800 Subject: Add parsing of vrrp interfaces so that 'show vrrp interfaces ' will do what the user intended. Users should still be prompted to use the underlying interface name, but if they enter the vmac interface instead we should 'do what they mean' --- scripts/keepalived/vyatta-show-vrrp.pl | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/keepalived/vyatta-show-vrrp.pl b/scripts/keepalived/vyatta-show-vrrp.pl index 818d5e40..ecf2bf75 100755 --- a/scripts/keepalived/vyatta-show-vrrp.pl +++ b/scripts/keepalived/vyatta-show-vrrp.pl @@ -301,6 +301,16 @@ if ($showsummary == 1) { } foreach my $intf (@intfs) { + my $intf_vrid; + if ($intf =~ m/(\w+)\.(\d+)v(\d+)/){ + $intf = "$1.$2"; + $intf_vrid = $3; + } elsif ($intf =~ m/(\w+)v(\d+)/){ + $intf = $1; + $intf_vrid = $2; + } + next if ($group ne 'all' && $intf_vrid && $intf_vrid != $group); + $group = $intf_vrid if ($group eq 'all' && $intf_vrid); my @state_files = Vyatta::Keepalived::get_state_files($intf, $group); foreach my $state_file (@state_files) { &$display_func($state_file); -- cgit v1.2.3