summaryrefslogtreecommitdiff
path: root/scripts/keepalived/vyatta-keepalived.pl
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/keepalived/vyatta-keepalived.pl')
-rwxr-xr-xscripts/keepalived/vyatta-keepalived.pl7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/keepalived/vyatta-keepalived.pl b/scripts/keepalived/vyatta-keepalived.pl
index 1deeafe8..fff1acf1 100755
--- a/scripts/keepalived/vyatta-keepalived.pl
+++ b/scripts/keepalived/vyatta-keepalived.pl
@@ -47,10 +47,15 @@ sub keepalived_get_values {
my $vrrp_instance = "vyatta-$intf-$group";
$config->setLevel("$path vrrp vrrp-group $group");
my @vips = $config->returnValues("virtual-address");
- if (scalar(@vips) == 0) {
+ my $num_vips = scalar(@vips);
+ if ($num_vips == 0) {
print "must define a virtual-address for vrrp-group $group\n";
exit 1;
}
+ if ($num_vips > 20) {
+ print "can not set more than 20 VIPs per group\n";
+ exit 1;
+ }
my $priority = $config->returnValue("priority");
if (!defined $priority) {
$priority = 1;