summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPiotr Dobrowolski <admin@tastycode.pl>2017-04-07 15:13:57 +0200
committerPiotr Dobrowolski <admin@tastycode.pl>2017-04-07 15:13:57 +0200
commitbd6a2d022892c993f10784f0d61caf6f3bb954a3 (patch)
tree09638394d28b9b254d47a152c5213a97c7b9cbc6
parentaf0c7e26fa44e66e0a56f0ad2c1f65de0fa60f0d (diff)
downloadlocal-letsencrypt-bd6a2d022892c993f10784f0d61caf6f3bb954a3.tar.gz
local-letsencrypt-bd6a2d022892c993f10784f0d61caf6f3bb954a3.tar.bz2
local-letsencrypt-bd6a2d022892c993f10784f0d61caf6f3bb954a3.zip
Update hooks, add dehydrated hook
-rwxr-xr-xclient/cleanup-hook.sh2
-rwxr-xr-xclient/dehydrated-hook.sh11
-rwxr-xr-xclient/install-hook.sh2
3 files changed, 13 insertions, 2 deletions
diff --git a/client/cleanup-hook.sh b/client/cleanup-hook.sh
index 73bf40f..5ab9cfc 100755
--- a/client/cleanup-hook.sh
+++ b/client/cleanup-hook.sh
@@ -2,4 +2,4 @@
. $(dirname $(realpath $0))/hook-config
-curl "$API_URL/api/1/delete?token=$API_TOKEN&record=_acme-challenge.$CERTBOT_DOMAIN&type=TXT"
+curl "$API_URL/api/1/delete?token=$API_TOKEN&record=_acme-challenge.$CERTBOT_DOMAIN:TXT"
diff --git a/client/dehydrated-hook.sh b/client/dehydrated-hook.sh
new file mode 100755
index 0000000..369f59d
--- /dev/null
+++ b/client/dehydrated-hook.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+CERTBOT_DOMAIN="$2"
+CERTBOT_VALIDATION="$4"
+
+case $1 in
+ deploy_challenge)
+ . $(dirname $(realpath $0))/install-hook.sh ;;
+ cleanup_challenge)
+ . $(dirname $(realpath $0))/cleanup-hook.sh ;;
+esac
diff --git a/client/install-hook.sh b/client/install-hook.sh
index fb78b26..0a0dd96 100755
--- a/client/install-hook.sh
+++ b/client/install-hook.sh
@@ -2,4 +2,4 @@
. $(dirname $(realpath $0))/hook-config
-curl "$API_URL/api/1/add?token=$API_TOKEN&record=_acme-challenge.$CERTBOT_DOMAIN&value=$CERTBOT_VALIDATION&type=TXT"
+curl "$API_URL/api/1/add?token=$API_TOKEN&record=_acme-challenge.$CERTBOT_DOMAIN:TXT&value=\"$CERTBOT_VALIDATION\""