From 5d18c6fca72ed68a7f1e655f16f1dcfac7739d88 Mon Sep 17 00:00:00 2001 From: aney1 Date: Tue, 17 Dec 2019 21:11:29 +0100 Subject: [PATCH] get domainID from CERTBOT_DOMAIN variable change proposed by ckhmer1 (https://github.com/aney1/certbot-domainvalidation-dynu/issues/1) --- scripts/script-pre.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/script-pre.sh b/scripts/script-pre.sh index 1490345..5ef77c0 100644 --- a/scripts/script-pre.sh +++ b/scripts/script-pre.sh @@ -1,6 +1,8 @@ #!/bin/bash api_key='' -domainID='' +#Get domainID: +dns=$(curl -X GET https://api.dynu.com/v2/dns -H "accept: application/json" -H "API-Key: $api_key") +domainID=$(echo $dns | jq ".domains[] | select(.name==\"$CERTBOT_DOMAIN\")" | jq '.id') #Create record