mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2026-05-18 20:03:55 +08:00
Merge pull request #6796 from Tra5is/add_technitium_expiry_ttl
Some checks failed
DNS / CheckToken (push) Has been cancelled
Build DockerHub / CheckToken (push) Has been cancelled
Shellcheck / ShellCheck (push) Has been cancelled
Shellcheck / shfmt (push) Has been cancelled
DNS / OpenBSD (push) Has been cancelled
DNS / Fail (push) Has been cancelled
DNS / Docker (push) Has been cancelled
DNS / MacOS (push) Has been cancelled
DNS / Windows (push) Has been cancelled
DNS / FreeBSD (push) Has been cancelled
DNS / NetBSD (push) Has been cancelled
DNS / DragonFlyBSD (push) Has been cancelled
DNS / Solaris (push) Has been cancelled
DNS / Omnios (push) Has been cancelled
DNS / OpenIndiana (push) Has been cancelled
DNS / Haiku (push) Has been cancelled
Build DockerHub / build (push) Has been cancelled
Some checks failed
DNS / CheckToken (push) Has been cancelled
Build DockerHub / CheckToken (push) Has been cancelled
Shellcheck / ShellCheck (push) Has been cancelled
Shellcheck / shfmt (push) Has been cancelled
DNS / OpenBSD (push) Has been cancelled
DNS / Fail (push) Has been cancelled
DNS / Docker (push) Has been cancelled
DNS / MacOS (push) Has been cancelled
DNS / Windows (push) Has been cancelled
DNS / FreeBSD (push) Has been cancelled
DNS / NetBSD (push) Has been cancelled
DNS / DragonFlyBSD (push) Has been cancelled
DNS / Solaris (push) Has been cancelled
DNS / Omnios (push) Has been cancelled
DNS / OpenIndiana (push) Has been cancelled
DNS / Haiku (push) Has been cancelled
Build DockerHub / build (push) Has been cancelled
Add Expiry TTL option for Technitium DNS API
This commit is contained in:
@@ -6,6 +6,7 @@ Docs: github.com/acmesh-official/acme.sh/wiki/dnsapi2#dns_technitium
|
|||||||
Options:
|
Options:
|
||||||
Technitium_Server Server Address
|
Technitium_Server Server Address
|
||||||
Technitium_Token API Token
|
Technitium_Token API Token
|
||||||
|
Technitium_Expiry_Ttl Number of seconds before DNS server auto-deletes the acme record
|
||||||
Issues: github.com/acmesh-official/acme.sh/issues/6116
|
Issues: github.com/acmesh-official/acme.sh/issues/6116
|
||||||
Author: Henning Reich <acmesh@qupfer.de>
|
Author: Henning Reich <acmesh@qupfer.de>
|
||||||
'
|
'
|
||||||
@@ -15,7 +16,10 @@ dns_technitium_add() {
|
|||||||
_Technitium_account
|
_Technitium_account
|
||||||
fulldomain=$1
|
fulldomain=$1
|
||||||
txtvalue=$2
|
txtvalue=$2
|
||||||
response="$(_get "$Technitium_Server/api/zones/records/add?token=$Technitium_Token&domain=$fulldomain&type=TXT&text=${txtvalue}")"
|
expiryTtl=${Technitium_Expirty_Ttl:-$(_readaccountconf_mutable Technitium_Expiry_Ttl)}
|
||||||
|
expiryTtl=${expiryTtl:-0}
|
||||||
|
|
||||||
|
response="$(_get "$Technitium_Server/api/zones/records/add?token=$Technitium_Token&domain=$fulldomain&type=TXT&text=${txtvalue}&expiryTtl=$expiryTtl")"
|
||||||
if _contains "$response" '"status":"ok"'; then
|
if _contains "$response" '"status":"ok"'; then
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
@@ -28,6 +32,14 @@ dns_technitium_rm() {
|
|||||||
_Technitium_account
|
_Technitium_account
|
||||||
fulldomain=$1
|
fulldomain=$1
|
||||||
txtvalue=$2
|
txtvalue=$2
|
||||||
|
expiryTtl=${Technitium_Expirty_Ttl:-$(_readaccountconf_mutable Technitium_Expiry_Ttl)}
|
||||||
|
expiryTtl=${expiryTtl:-0}
|
||||||
|
|
||||||
|
if [ "$expiryTtl" -ne 0 ]; then
|
||||||
|
_info "DNS record is configured to be auto-removed after $expiryTtl seconds. Remove operation is bypassed."
|
||||||
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
response="$(_get "$Technitium_Server/api/zones/records/delete?token=$Technitium_Token&domain=$fulldomain&type=TXT&text=${txtvalue}")"
|
response="$(_get "$Technitium_Server/api/zones/records/delete?token=$Technitium_Token&domain=$fulldomain&type=TXT&text=${txtvalue}")"
|
||||||
if _contains "$response" '"status":"ok"'; then
|
if _contains "$response" '"status":"ok"'; then
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
Reference in New Issue
Block a user