Last active
May 27, 2020 11:08
-
-
Save mrizvic/1a08bee85e760ab9df41e6d7b57eca34 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 | |
### RUNNING: | |
#certbot certonly -d host.domain.tld --agree-tos --manual --preferred-challenges=dns --manual-auth-hook /root/certbot-hook-dns-auth.sh --manual-public-ip-logging-ok | |
HOST="_acme-challenge" | |
DYNZONE="SET_YOURDOMAIN_NAME" | |
if [ -z "$CERTBOT_DOMAIN" ] || [ -z "$CERTBOT_VALIDATION" ] || [ -z "$DYNZONE" ] | |
then | |
echo "EMPTY DOMAIN OR VALIDATION OR ZONE" | |
exit -1 | |
fi | |
echo $DYNZONE | |
echo $CERTBOT_DOMAIN | |
echo $CERTBOT_VALIDATION | |
echo $HOST | |
/usr/bin/nsupdate << EOM | |
zone ${DYNZONE} | |
update delete ${HOST}.${CERTBOT_DOMAIN} TXT | |
update add ${HOST}.${CERTBOT_DOMAIN} 10 TXT "${CERTBOT_VALIDATION}" | |
send | |
EOM | |
echo "" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment