diff options
| author | slioch <slioch@eng-140.vyatta.com> | 2009-07-07 14:33:15 -0700 |
|---|---|---|
| committer | slioch <slioch@eng-140.vyatta.com> | 2009-07-07 14:33:15 -0700 |
| commit | 4000b742f9eb731d40d22d6e73daef466a0e34ee (patch) | |
| tree | 53a57bbb91b1f2b9b5b33f0acf2b8a35a240cb9f /scripts | |
| parent | 45760b0cc60d9f1f307fa3db5d420876f833a38d (diff) | |
| download | vyatta-wanloadbalance-4000b742f9eb731d40d22d6e73daef466a0e34ee.tar.gz vyatta-wanloadbalance-4000b742f9eb731d40d22d6e73daef466a0e34ee.zip | |
added configuration hook to execute script on interface state change. configurable via conf mode. environment variables identify interface and new state.
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/vyatta-wanloadbalance.pl | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/scripts/vyatta-wanloadbalance.pl b/scripts/vyatta-wanloadbalance.pl index 6016f33..f541ea3 100644 --- a/scripts/vyatta-wanloadbalance.pl +++ b/scripts/vyatta-wanloadbalance.pl @@ -33,11 +33,15 @@ sub write_health { print FILE_LCK "flush-conntrack\n"; } - $config->setLevel("load-balancing wan interface-health"); - my @eths = $config->listNodes(); - print FILE_LCK "health {\n"; + my $hook = $config->returnValue("load-balancing wan hook"); + if (defined $hook) { + print FILE_LCK "\thook \"" . $hook . "\"\n"; + } + + $config->setLevel("load-balancing wan interface-health"); + my @eths = $config->listNodes(); foreach my $ethNode (@eths) { print FILE_LCK "\tinterface " . $ethNode . " {\n"; |
