From 8529fbe7ed23023e936f5c7cab9663007d0476d3 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Wed, 26 Jan 2011 14:24:13 -0800 Subject: Fix vrrp duplicate generation of last sync-group entry. --- scripts/keepalived/vyatta-keepalived.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/keepalived/vyatta-keepalived.pl b/scripts/keepalived/vyatta-keepalived.pl index 9b8358d2..7a113469 100755 --- a/scripts/keepalived/vyatta-keepalived.pl +++ b/scripts/keepalived/vyatta-keepalived.pl @@ -391,11 +391,12 @@ sub remove_from_changes { sub vrrp_update_config { my @errs = (); - my $output = "#\n# autogenerated by $0\n#\n\n"; + my $output; my $config = new Vyatta::Config; my $vrrp_instances = 0; + %HoA_sync_groups = (); foreach my $name ( getInterfaces() ) { my $intf = new Vyatta::Interface($name); next unless $intf; @@ -427,6 +428,7 @@ sub vrrp_update_config { if ( defined $sync_groups && $sync_groups ne "" ) { $output = $sync_groups . $output; } + $output = "#\n# autogenerated by $0\n#\n\n" . $output; keepalived_write_file( $conf_file, $output ); } return ( $vrrp_instances, @errs ); -- cgit v1.2.3