From fa76fb6b1d99218cfd3a181b8dcc718d83906f93 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Thu, 3 Jun 2010 16:29:20 -0700 Subject: move list functions to vrrp perl module so other scripts can use it as well --- scripts/keepalived/vyatta-keepalived.pl | 34 +++------------------------------ 1 file changed, 3 insertions(+), 31 deletions(-) diff --git a/scripts/keepalived/vyatta-keepalived.pl b/scripts/keepalived/vyatta-keepalived.pl index 2c84f252..b891bdf7 100755 --- a/scripts/keepalived/vyatta-keepalived.pl +++ b/scripts/keepalived/vyatta-keepalived.pl @@ -205,7 +205,9 @@ sub vrrp_get_sync_groups { foreach my $vrrp_instance ( 0 .. $#{ $HoA_sync_groups{$sync_group} } ) { $output .= "\t\t$HoA_sync_groups{$sync_group}[$vrrp_instance]\n"; } - $output .= "\t\}\n\}\n"; + $output .= "\t\}\n"; + ## add conntrack-sync part here if configured ## + $output .= "\}\n"; } return $output; } @@ -354,36 +356,6 @@ sub keepalived_write_file { close $fh; } -sub list_vrrp_intf { - my $config = new Vyatta::Config; - my @intfs = (); - - foreach my $name ( getInterfaces() ) { - my $intf = new Vyatta::Interface($name); - next unless $intf; - my $path = $intf->path(); - $config->setLevel($path); - push @intfs, $name if $config->existsOrig("vrrp"); - } - - return @intfs; -} - -sub list_vrrp_group { - my ($name) = @_; - my $config = new Vyatta::Config; - my $path; - - my $intf = new Vyatta::Interface($name); - next unless $intf; - $path = $intf->path(); - $path .= " vrrp vrrp-group"; - $config->setLevel($path); - my @groups = $config->listOrigNodes(); - return @groups; -} - - # # main # -- cgit v1.2.3