diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-12-06 11:43:48 -0800 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-12-06 11:43:48 -0800 |
commit | 889f218328589847ec699292863e5b3ed2c936d5 (patch) | |
tree | 508a6edac9c8d9253d8996750ec3747b96c97b44 /scripts | |
parent | fa84fe0e3b0f2fac340ac8e51148d47006a1880f (diff) | |
download | vyatta-cfg-system-889f218328589847ec699292863e5b3ed2c936d5.tar.gz vyatta-cfg-system-889f218328589847ec699292863e5b3ed2c936d5.zip |
Add parsing of vrrp interfaces so that 'show vrrp interfaces <vmac-interface>' 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'
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/keepalived/vyatta-show-vrrp.pl | 10 |
1 files changed, 10 insertions, 0 deletions
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); |