Created
August 20, 2021 17:58
-
-
Save kronthto/893715f12cc0b1cda9fcfdbd8dc176b8 to your computer and use it in GitHub Desktop.
certbot DNS challenge nsupdate
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 | |
# use with: manual_auth_hook = /usr/local/sbin/dns-challenge.sh | |
if [ -z "$CERTBOT_DOMAIN" ] || [ -z "$CERTBOT_VALIDATION" ] | |
then | |
echo "EMPTY DOMAIN OR VALIDATION" | |
exit -1 | |
fi | |
HOST="_acme-challenge" | |
/usr/bin/nsupdate << EOM | |
server 127.0.0.1 | |
zone ${HOST}.${CERTBOT_DOMAIN} | |
update add ${HOST}.${CERTBOT_DOMAIN} 300 TXT "${CERTBOT_VALIDATION}" | |
send | |
EOM | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment