From 829ce75856f8511f286a5fbb341d7282e805b2af Mon Sep 17 00:00:00 2001 From: CertainLach Date: Sun, 10 Feb 2019 18:18:59 +0500 Subject: [PATCH] Add support for zeit dns TODO: Use sed/awk for domain parsing (I am bad at it) Write removal function Use rest api instead of now cli --- dnsapi/dns_zeit.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 dnsapi/dns_zeit.sh diff --git a/dnsapi/dns_zeit.sh b/dnsapi/dns_zeit.sh new file mode 100644 index 00000000..f0d818c4 --- /dev/null +++ b/dnsapi/dns_zeit.sh @@ -0,0 +1,19 @@ +#!/usr/bin/bash + +######## Public functions ##################### + +#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs" +dns_zeit_add() { + fulldomain=$1 + txtvalue=$2 + subdomain=$(echo $fulldomain | node -e "process.stdin.on('data',e=>console.log(e.toString().split('.').slice(0,-2).join('.')))") + domain=$(echo $fulldomain | node -e "process.stdin.on('data',e=>console.log(e.toString().split('.').slice(-2).join('.').trim()))") + now dns add $domain $subdomain TXT $txtvalue +} + +#fulldomain txtvalue +dns_zeit_rm() { + fulldomain=$1 + txtvalue=$2 + +}