summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorStig Thormodsrud <stig@vyatta.com>2008-05-21 20:28:57 -0700
committerStig Thormodsrud <stig@vyatta.com>2008-05-21 20:28:57 -0700
commit6696d2352b157a869bcbe96a364aaf6b65cf9770 (patch)
treeed85ccb79bb0613c3da74a2d7b4e102ccf32056b /scripts
parentb931612b5d74e198377df9d54edb1dd024451e5a (diff)
downloadvyatta-cfg-quagga-6696d2352b157a869bcbe96a364aaf6b65cf9770.tar.gz
vyatta-cfg-quagga-6696d2352b157a869bcbe96a364aaf6b65cf9770.zip
Fix 3273: "show vrrp summary" output doesn't line-up when using vlans
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/keepalived/vyatta-show-vrrp.pl13
1 files changed, 8 insertions, 5 deletions
diff --git a/scripts/keepalived/vyatta-show-vrrp.pl b/scripts/keepalived/vyatta-show-vrrp.pl
index 78e58970..4910e092 100755
--- a/scripts/keepalived/vyatta-show-vrrp.pl
+++ b/scripts/keepalived/vyatta-show-vrrp.pl
@@ -176,9 +176,10 @@ sub vrrp_showsummary {
if ($state eq "master" || $state eq "backup" || $state eq "fault") {
my ($primary_addr, $priority, $preempt, $advert_int, $auth_type,
@vips) = VyattaKeepalived::vrrp_get_config($intf, $group);
- print "\n$intf\t\t$group\tint\t$primary_addr\t$link\t\t$state";
+ my $format = "\n%-16s%-8s%-8s%-16s%-16s%-16s";
+ printf($format, $intf, $group, 'int', $primary_addr, $link, $state);
foreach my $vip (@vips){
- print "\n\t\t\tvip\t$vip";
+ printf("\n%-24s%-8s%-16s", ' ', 'vip', $vip);
}
} else {
print "Physical interface $intf, State: unknown\n";
@@ -262,9 +263,11 @@ if (!VyattaKeepalived::is_running()) {
my $display_func;
if ($showsummary == 1) {
$display_func = \&vrrp_showsummary;
- print "\t\tVRRP\tAddr\t\t\tInterface\tVRRP\n";
- print "Interface\tGroup\tType\tAddress\t\tState\t\tState\n";
- print "---------\t-----\t----\t-------\t\t-----\t\t-----";
+ my $format = '%-16s%-8s%-8s%-16s%-16s%-16s%s';
+ printf($format, '', 'VRRP', 'Addr', '', 'Interface', 'VRRP', "\n");
+ printf($format, 'Interface', 'Group', 'Type', 'Address', 'State', 'State',
+ "\n");
+ printf($format, '-' x 9, '-' x 5, '-' x 4 , '-' x 7, '-' x 5, '-' x 5, '');
} else {
$display_func = \&vrrp_show;
}