Update cloudflare_certbot_dns01_auth.sh, cloudflare_cerbot_dns01_cleanup.sh
This commit is contained in:
1 parent
27afefe596
commit
c7805b6a76
2 files changed
+25
No files matched your search
@@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Get your API key from https://www.cloudflare.com/a/account/my-account
|
||||
API_KEY="your-api-key"
|
||||
EMAIL="your.email@example.com"
|
||||
|
||||
if [ -f /tmp/CERTBOT_$CERTBOT_DOMAIN/ZONE_ID ]; then
|
||||
ZONE_ID=$(cat /tmp/CERTBOT_$CERTBOT_DOMAIN/ZONE_ID)
|
||||
rm -f /tmp/CERTBOT_$CERTBOT_DOMAIN/ZONE_ID
|
||||
fi
|
||||
|
||||
if [ -f /tmp/CERTBOT_$CERTBOT_DOMAIN/RECORD_ID ]; then
|
||||
RECORD_ID=$(cat /tmp/CERTBOT_$CERTBOT_DOMAIN/RECORD_ID)
|
||||
rm -f /tmp/CERTBOT_$CERTBOT_DOMAIN/RECORD_ID
|
||||
fi
|
||||
|
||||
# Remove the challenge TXT record from the zone
|
||||
if [ -n "${ZONE_ID}" ]; then
|
||||
if [ -n "${RECORD_ID}" ]; then
|
||||
curl -s -X DELETE "https://api.cloudflare.com/client/v4/zones/$ZONE_ID/dns_records/$RECORD_ID" \
|
||||
-H "X-Auth-Email: $EMAIL" \
|
||||
-H "X-Auth-Key: $API_KEY" \
|
||||
-H "Content-Type: application/json"
|
||||
fi
|
||||
fi
|
||||
File renamed without changes.
Reference in new issue
Block a user