From cec470e9bb77d523c889751a29fbadb74714d5ad Mon Sep 17 00:00:00 2001 From: aney1 Date: Wed, 18 Dec 2019 21:02:23 +0100 Subject: [PATCH] get domainID from CERTBOT_DOMAIN variable --- scripts/script-post.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/scripts/script-post.sh b/scripts/script-post.sh index a624e96..045c919 100644 --- a/scripts/script-post.sh +++ b/scripts/script-post.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') while records=$(curl -s -X GET "https://api.dynu.com/v2/dns/$domainID/record" -H "accept: application/json" -H "API-Key: $api_key")