Skip to content

Instantly share code, notes, and snippets.

@yuchangyuan
Created May 7, 2021 12:40
Show Gist options
  • Save yuchangyuan/952cfa6106b1ae68297da63859a13bc7 to your computer and use it in GitHub Desktop.
Save yuchangyuan/952cfa6106b1ae68297da63859a13bc7 to your computer and use it in GitHub Desktop.
apikey="API_KEY TO FILL"
function up_txt {
host="$1"
val="$2"
remote="https://zonomi.com/app/dns/dyndns.jsp"
url="${remote}?host=${host}&api_key=${apikey}&ttl=300&type=TXT&value=${val}"
#curl -k -s "$url" &> "/var/lib/letsencrypt/dns_txt.${host}.log"
python -c "import requests; print(requests.get(url='$url', verify=False).text)" &> "/var/lib/letsencrypt/dns_txt.${host}.log"
}
up_txt "_acme-challenge.$CERTBOT_DOMAIN" "$CERTBOT_VALIDATION"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment