summaryrefslogtreecommitdiff
path: root/scripts/keepalived/VyattaKeepalived.pm
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/keepalived/VyattaKeepalived.pm')
-rwxr-xr-xscripts/keepalived/VyattaKeepalived.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/keepalived/VyattaKeepalived.pm b/scripts/keepalived/VyattaKeepalived.pm
index e0e84af3..13512b42 100755
--- a/scripts/keepalived/VyattaKeepalived.pm
+++ b/scripts/keepalived/VyattaKeepalived.pm
@@ -115,11 +115,16 @@ sub get_master_file {
}
sub get_state_files {
- my $intf = shift;
+ my ($intf, $group) = @_;
# todo: fix sorting for ethX > 9
my @state_files;
- open(my $LS, "ls $state_dir |grep '^vrrpd_$intf.*\.state\$' | sort |");
+ my $LS;
+ if ($group eq "all") {
+ open($LS,"ls $state_dir |grep '^vrrpd_$intf.*\.state\$' | sort |");
+ } else {
+ open($LS,"ls $state_dir |grep '^vrrpd_$intf.\_$group\.state\$' | sort |");
+ }
@state_files = <$LS>;
close($LS);
foreach my $i (0 .. $#state_files) {