get domainID from CERTBOT_DOMAIN variable

This commit is contained in:
aney1 2019-12-18 21:02:23 +01:00 committed by GitHub
parent 5d18c6fca7
commit cec470e9bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,8 @@
#!/bin/bash #!/bin/bash
api_key='<PUT_YOUR_API_KEY_HERE>' 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')
while while
records=$(curl -s -X GET "https://api.dynu.com/v2/dns/$domainID/record" -H "accept: application/json" -H "API-Key: $api_key") records=$(curl -s -X GET "https://api.dynu.com/v2/dns/$domainID/record" -H "accept: application/json" -H "API-Key: $api_key")