get domainID from CERTBOT_DOMAIN variable

change proposed by ckhmer1 (https://github.com/aney1/certbot-domainvalidation-dynu/issues/1)
This commit is contained in:
aney1 2019-12-17 21:11:29 +01:00 committed by GitHub
parent 35b5b16255
commit 5d18c6fca7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,8 @@
#!/bin/bash
api_key='<PUT_YOUR_API_KEY_HERE>'
domainID='<PUT_YOUR_DOMAIN_ID_HERE>'
#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