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