certbot_knot_hooks/same-server-authenticator-h...

13 lines
419 B
Bash
Executable File

#!/bin/bash
set -x
DOMAIN=$(expr match "$CERTBOT_DOMAIN" '.*\.\(.*\..*\)')
CHALLENGE_DOMAIN="_acme-challenge.${CERTBOT_DOMAIN}"
[[ -z ${DOMAIN} ]] && export DOMAIN=${CERTBOT_DOMAIN}
knotc zone-begin ${DOMAIN}
knotc zone-set ${DOMAIN} _acme-challenge.${CERTBOT_DOMAIN}. 360 TXT ${CERTBOT_VALIDATION}
knotc zone-commit ${DOMAIN}
echo "${CERTBOT_VALIDATION}" > /tmp/certbot_validation_txt_${CERTBOT_DOMAIN}.txt
sleep 25