summaryrefslogtreecommitdiff
path: root/src/lbdecision.cc
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2021-11-30 16:29:23 +0700
committerGitHub <noreply@github.com>2021-11-30 16:29:23 +0700
commitac518f1494fd1f014c90d3354eabbb7e33a22f30 (patch)
treefa9f2f1b669050f03d9baf01e8c344c5bfec7b42 /src/lbdecision.cc
parente796b6a9dbf8eaa66b746a75c3211d9ea7ac458b (diff)
parent69a6a8a153b8c53de66bfb9c72a113bd42afa989 (diff)
downloadvyatta-wanloadbalance-lithium.tar.gz
vyatta-wanloadbalance-lithium.zip
Merge pull request #6 from EwaldvanGeffen/lithiumlithium
Bug 590 & 363
Diffstat (limited to 'src/lbdecision.cc')
-rw-r--r--src/lbdecision.cc19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lbdecision.cc b/src/lbdecision.cc
index 665b2a2..fd5fd62 100644
--- a/src/lbdecision.cc
+++ b/src/lbdecision.cc
@@ -434,6 +434,25 @@ LBDecision::run(LBData &lb_data)
}
++iter;
}
+
+ map<string,string>::iterator post_iter = state_changed_coll.begin();
+ while (post_iter != state_changed_coll.end()) {
+ //set state
+ //set interface
+ if (lb_data._post_hook.empty() == false) {
+ setenv("WLB_INTERFACE_NAME",post_iter->first.c_str(),1);
+ setenv("WLB_INTERFACE_STATE",post_iter->second.c_str(),1);
+
+ syslog(LOG_WARNING, "executing script: %s",lb_data._post_hook.c_str());
+
+ execute(lb_data._post_hook, stdout);
+ //unset state
+ //unset interface
+ unsetenv("WLB_INTERFACE_NAME");
+ unsetenv("WLB_INTERFACE_STATE");
+ }
+ ++post_iter;
+ }
}
/**