From 50bb94f593eea5776edc7eb9764d877be85e6e32 Mon Sep 17 00:00:00 2001 From: srvrco Date: Wed, 15 Jun 2016 15:17:32 +0100 Subject: [PATCH] adding example dns challenge scripts --- dns_scripts/dns_add_cloudflare | 26 +++++++++++++++++++++++++ dns_scripts/dns_add_nsupdate | 16 ++++++++++++++++ dns_scripts/dns_del_cloudflare | 35 ++++++++++++++++++++++++++++++++++ dns_scripts/dns_del_nsupdate | 15 +++++++++++++++ 4 files changed, 92 insertions(+) create mode 100755 dns_scripts/dns_add_cloudflare create mode 100755 dns_scripts/dns_add_nsupdate create mode 100755 dns_scripts/dns_del_cloudflare create mode 100755 dns_scripts/dns_del_nsupdate diff --git a/dns_scripts/dns_add_cloudflare b/dns_scripts/dns_add_cloudflare new file mode 100755 index 0000000..cb878eb --- /dev/null +++ b/dns_scripts/dns_add_cloudflare @@ -0,0 +1,26 @@ +#!/bin/bash + +# need to add your email address and key to cloudflare below +email="" +key="" + +fulldomain="$1" +token="$2" + +NumParts=$(echo "$fulldomain" | awk -F"." '{print NF}') +if [[ $NumParts -gt 2 ]]; then + domain=$(echo "$fulldomain" | awk -F\. '{print $(NF-1) FS $NF}') + txtname="_acme-challenge$(echo $fulldomain | awk -F\. '{for (i=1; i "${updatefile}" + +nsupdate -k "${dnskeyfile}" -v "${updatefile}" + +rm -f ${updatefile} diff --git a/dns_scripts/dns_del_cloudflare b/dns_scripts/dns_del_cloudflare new file mode 100755 index 0000000..c92cf67 --- /dev/null +++ b/dns_scripts/dns_del_cloudflare @@ -0,0 +1,35 @@ +#!/bin/bash + +# need to add your email address and key to cloudflare below +email="" +key="" + +fulldomain="$1" + +NumParts=$(echo "$fulldomain" | awk -F"." '{print NF}') +if [[ $NumParts -gt 2 ]]; then + domain=$(echo "$fulldomain" | awk -F\. '{print $(NF-1) FS $NF}') + txtname="_acme-challenge$(echo $fulldomain | awk -F\. '{for (i=1; i "${updatefile}" + +nsupdate -k "${dnskeyfile}" -v "${updatefile}" + +rm -f ${updatefile}