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 1/3] 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 +} From 9dc797bc193046ffc8ac8e3e599af776dba18e49 Mon Sep 17 00:00:00 2001 From: Tone <66808319+Tone866@users.noreply.github.com> Date: Fri, 14 Mar 2025 00:32:11 +0100 Subject: [PATCH 2/3] Update dns_myaddr.sh --- dnsapi/dns_myaddr.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/dnsapi/dns_myaddr.sh b/dnsapi/dns_myaddr.sh index 891ede0b..dc3f47e8 100644 --- a/dnsapi/dns_myaddr.sh +++ b/dnsapi/dns_myaddr.sh @@ -24,6 +24,5 @@ dns_myaddr_add() { } dns_myaddr_rm() { - #this is just to prevent an error in acme.sh, myaddr will automatic remove the txts after few minutes - fulldomain=$1 + _debug "this is just to prevent an error in acme.sh, myaddr will automatic remove the txts after few minutes" } From da31435016fe150f748f26ec3c260462a915cbd0 Mon Sep 17 00:00:00 2001 From: Tone <66808319+Tone866@users.noreply.github.com> Date: Fri, 14 Mar 2025 00:34:13 +0100 Subject: [PATCH 3/3] Update dns_myaddr.sh --- dnsapi/dns_myaddr.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/dnsapi/dns_myaddr.sh b/dnsapi/dns_myaddr.sh index dc3f47e8..7860dfff 100644 --- a/dnsapi/dns_myaddr.sh +++ b/dnsapi/dns_myaddr.sh @@ -1,7 +1,6 @@ #!/usr/bin/env sh dns_myaddr_add() { - fulldomain=$1 txtvalue=$2 myaddr_key="${myaddr_key:-$(_readaccountconf_mutable myaddr_key)}"