Created
January 12, 2022 14:40
-
-
Save dfar-io/14608fb10cbfdbb3e05649c78a0e876c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Deletes the appropriate TXT record after creating a Let's Encrypt certificate. | |
# exit when any command fails | |
set -e | |
if [ "$1" == "" ] || [ "$2" == "" ] | |
then | |
echo "GODADDY_API_KEY and GODADDY_API_SECRET arguments required." | |
exit 1 | |
fi | |
# split domain provided | |
IFS='.' read -ra domain <<< "$CERTBOT_DOMAIN" | |
curl --request DELETE \ | |
--url "https://api.godaddy.com/v1/domains/${domain[1]}.${domain[2]}/records/TXT/_acme-challenge.${domain[0]}" \ | |
--header "Authorization: sso-key $1:$2" \ | |
--header 'Content-Type: application/json' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment