From e2e01c8a590634c845239d6226ece29077a5d196 Mon Sep 17 00:00:00 2001 From: Tone <66808319+Tone866@users.noreply.github.com> Date: Fri, 14 Mar 2025 00:27:47 +0100 Subject: [PATCH] Create dns_myaddr.sh --- dnsapi/dns_myaddr.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 dnsapi/dns_myaddr.sh diff --git a/dnsapi/dns_myaddr.sh b/dnsapi/dns_myaddr.sh new file mode 100644 index 00000000..891ede0b --- /dev/null +++ b/dnsapi/dns_myaddr.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env sh + +dns_myaddr_add() { + fulldomain=$1 + txtvalue=$2 + + myaddr_key="${myaddr_key:-$(_readaccountconf_mutable myaddr_key)}" + if [ -z "$myaddr_key" ]; then + myaddr_key="" + _err "You don't specify api key yet." + _err "Please create your key and try again." + return 1 + fi + + #save the credentials to the account conf file. + _saveaccountconf_mutable myaddr_key "$myaddr_key" + + data="key=${myaddr_key}&acme_challenge=${txtvalue}" + _post "${data}" 'https://myaddr.tools/update' + + if [ "$?" != "0" ]; then + _err "Failed to send message" + fi +} + +dns_myaddr_rm() { + #this is just to prevent an error in acme.sh, myaddr will automatic remove the txts after few minutes + fulldomain=$1 +}