You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
486 B

#!/bin/bash
set -x
export CERTBOT_DOMAIN=${1}
export CERTBOT_VALIDATION=${2}
DOMAIN=$(expr match "$CERTBOT_DOMAIN" '.*\.\(.*\..*\)')
CHALLENGE_DOMAIN="_acme-challenge.${CERTBOT_DOMAIN}"
[[ -z ${DOMAIN} ]] && export DOMAIN=${CERTBOT_DOMAIN}
sed -e "s DOMAIN_NAME ${DOMAIN} g" -e "s SUBDOMAIN ${CERTBOT_DOMAIN} g" -e "s VALIDATION_STRING ${CERTBOT_VALIDATION} g" ddns_update > /tmp/certbot_ddns_update
knsupdate /tmp/certbot_ddns_update
[[ ${?} == 0 ]] && rm -f /tmp/certbot_ddns_update