From 4000b742f9eb731d40d22d6e73daef466a0e34ee Mon Sep 17 00:00:00 2001 From: slioch Date: Tue, 7 Jul 2009 14:33:15 -0700 Subject: added configuration hook to execute script on interface state change. configurable via conf mode. environment variables identify interface and new state. --- scripts/vyatta-wanloadbalance.pl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'scripts') 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"; -- cgit v1.2.3