summaryrefslogtreecommitdiff
path: root/host-control
diff options
context:
space:
mode:
Diffstat (limited to 'host-control')
-rwxr-xr-xhost-control23
1 files changed, 23 insertions, 0 deletions
diff --git a/host-control b/host-control
index 47f8716..c9e0cb0 100755
--- a/host-control
+++ b/host-control
@@ -85,6 +85,29 @@ class host_control():
return None
+ # hook
+
+ def hook_lookup(self, host, name):
+ if not "hooks" in host:
+ self.print_message("No hooks in host: " + self.host)
+ return None
+
+ for h in host["hooks"]:
+ if not "target" in h:
+ continue
+
+ if h["target"] == name:
+ return h
+
+ self.print_message("No hook for " + name + " in host: " + self.host)
+ return None
+
+ def hook_command(self, hook):
+ if "command" not in hook:
+ return None
+
+ return [ hook["command"] ]
+
# config
def config_path(self):