summaryrefslogtreecommitdiff
path: root/src/lbdecision.cc
diff options
context:
space:
mode:
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;
+ }
}
/**