From bd6a2d022892c993f10784f0d61caf6f3bb954a3 Mon Sep 17 00:00:00 2001 From: Piotr Dobrowolski Date: Fri, 7 Apr 2017 15:13:57 +0200 Subject: [PATCH] Update hooks, add dehydrated hook --- client/cleanup-hook.sh | 2 +- client/dehydrated-hook.sh | 11 +++++++++++ client/install-hook.sh | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) create mode 100755 client/dehydrated-hook.sh 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\""