diff options
author | slioch <slioch@eng-140.vyatta.com> | 2009-07-08 09:23:29 -0700 |
---|---|---|
committer | slioch <slioch@eng-140.vyatta.com> | 2009-07-08 09:23:29 -0700 |
commit | 8fd0204c883ca175c754d96b83433f084a7cc2ee (patch) | |
tree | 25b22c21952d86d9cc0de2a34849f845c6bc63e8 /scripts | |
parent | 1daffa872e69e444079fb4e1b82af9d11fbc37d3 (diff) | |
download | vyatta-wanloadbalance-8fd0204c883ca175c754d96b83433f084a7cc2ee.tar.gz vyatta-wanloadbalance-8fd0204c883ca175c754d96b83433f084a7cc2ee.zip |
fix for bug 4698
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/vyatta-wanloadbalance.pl | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/scripts/vyatta-wanloadbalance.pl b/scripts/vyatta-wanloadbalance.pl index f541ea3..397591b 100644 --- a/scripts/vyatta-wanloadbalance.pl +++ b/scripts/vyatta-wanloadbalance.pl @@ -12,6 +12,7 @@ use lib "/opt/vyatta/share/perl5/"; use Vyatta::Config; use Vyatta::Misc; use Vyatta::TypeChecker; +use Getopt::Long; use warnings; use strict; @@ -235,12 +236,28 @@ sub write_rules { return $valid; } +my $nexthop; +sub usage { + exit 1; +} + +GetOptions("valid-nexthop=s" => \$nexthop, + ) or usage(); ####main my $conf_file = '/var/load-balance/wlb.conf'; my $conf_lck_file = '/var/load-balance/wlb.conf.lck'; +####are we just validating? +if (defined $nexthop) { + my $rc = Vyatta::TypeChecker::validateType('ipv4', $nexthop, 1); + if (!$rc && $nexthop ne "dhcp") { + exit 1; + } + exit 0; +} + #open file open(FILE, "<$conf_file") or die "Can't open wlb config file"; open(FILE_LCK, "+>$conf_lck_file") or die "Can't open wlb lock file"; |