forked from mythic-beasts/dehydrated-code-rack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode-rack
More file actions
executable file
·35 lines (30 loc) · 937 Bytes
/
Copy pathcode-rack
File metadata and controls
executable file
·35 lines (30 loc) · 937 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env bash
# dehydrated-code-rack - easily invoke multiple dehydrated hooks
# Copyright (c) 2018 Mythic Beasts Ltd
# All right reserved
handler="$1"; shift
case $handler in
deploy_challenge|clean_challenge)
export DOMAIN="$1" TOKEN_FILENAME="$2" TOKEN_VALUE="$3"
# allow chaining - see documentation
args=''
while [ "$1" ]; do args="$args$1 $2 $3"$'\n'; shift 3; done
export ARGS="$args"
;;
deploy_cert|unchanged_cert)
export DOMAIN="$1"
export KEYFILE="$2" CERTFILE="$3" FULLCHAINFILE="$4" CHAINFILE="$5"
export TIMESTAMP="$6" # not set for unchanged_cert
;;
invalid_challenge)
export DOMAIN="$1" RESPONSE="$2"
;;
request_failure)
export STATUSCODE="$1" REASON="$2" REQTYPE="$3"
;;
exit_hook)
;;
esac
dir="$(dirname "$0")"/${handler//_/-}
/bin/mkdir -p "$dir"
/bin/run-parts "$dir"