From fdf054d3de0d99d6b9df6ec543a198d4b9711de1 Mon Sep 17 00:00:00 2001 From: Noah Huppert Date: Mon, 27 Mar 2017 20:31:57 -0400 Subject: [PATCH] Created a wiki page detailing how to use multiple hooks --- Example:-Using-multiple-hooks.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Example:-Using-multiple-hooks.md diff --git a/Example:-Using-multiple-hooks.md b/Example:-Using-multiple-hooks.md new file mode 100644 index 0000000..eba7fbc --- /dev/null +++ b/Example:-Using-multiple-hooks.md @@ -0,0 +1,13 @@ +Although Dehydrated does not allow you to specify multiple hooks this behavior can be easily hacked together. + +This can be done by creating a "proxy" hook that calls the multiple hooks you wish to execute. The simplest way to do this is with a bash script that uses `$@` to pass all command line arguments to any hooks you wish to excecute: +```bash +#!/usr/bin/env bash +# Simple script which allows the use of multiple hooks +# Put hooks in the order you wish them to be called here: +# (Be sure to keep in mind the working directory *this* hook will be called from when specifying other hook paths.) +./hooks/cloudflare/hook.py "$@" # Hook for automatic DNS-01 challenge deployment on Cloudflare +./hooks/custom/reboot.py "$@" # Made up hook which reboots a made up Nginx server +``` + +Then all you have to do is specify the proxy hook with either the `HOOK` key in a configuration file or the `-k` command line argument. \ No newline at end of file