added scripts for validating from a remote server

master
Danny Martinez 2020-05-11 22:58:02 -04:00
parent 4969b28251
commit 9c1987d1d6
6 changed files with 35 additions and 0 deletions

7
ddns_cleanup Normal file
View File

@ -0,0 +1,7 @@
server ns1.keybored.co
zone DOMAIN_NAME
origin DOMAIN_NAME
key home_keyboredme:G/nBHnetXDKJrKOboGkNOMyn3tOtq4aBihdMU0eqUU8=
ttl 360
del SUBDOMAIN 360 txt
send

View File

@ -1,6 +1,7 @@
server DNS_SERVER
zone DOMAIN_NAME
origin DOMAIN_NAME
key KNOTC_KEY
ttl 360
del SUBDOMAIN 360 txt
send

7
ddns_update Normal file
View File

@ -0,0 +1,7 @@
server ns1.keybored.co
zone DOMAIN_NAME
origin DOMAIN_NAME
key home_keyboredme:G/nBHnetXDKJrKOboGkNOMyn3tOtq4aBihdMU0eqUU8=
ttl 360
add SUBDOMAIN 360 txt VALIDATION_STRING
send

View File

@ -1,5 +1,6 @@
server DNS_SERVER
zone DOMAIN_NAME
key KNOTC_KEY
origin DOMAIN_NAME
ttl 360
add SUBDOMAIN 360 txt VALIDATION_STRING

View File

@ -0,0 +1,10 @@
#!/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

9
remote-server-cleanup.sh Executable file
View File

@ -0,0 +1,9 @@
#!/bin/bash
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" > /tmp/cerbot_ddns_cleanup
knsupdate /tmp/certbot_ddns_cleanup
[[ ${?} == 0 ]] && rm -f /tmp/certbot_ddns_cleanup