mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-11-16 11:21:47 +00:00
Added dns_lexicon_rm command.
Remove created TXT record when finished. Works with lexicon version 2.3.0 and later.
This commit is contained in:
parent
411b342a27
commit
8d230dd798
@ -7,15 +7,7 @@ lexicon_cmd="lexicon"
|
|||||||
|
|
||||||
wiki="https://github.com/Neilpang/acme.sh/wiki/How-to-use-lexicon-dns-api"
|
wiki="https://github.com/Neilpang/acme.sh/wiki/How-to-use-lexicon-dns-api"
|
||||||
|
|
||||||
######## Public functions #####################
|
_initLexicon() {
|
||||||
|
|
||||||
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
|
|
||||||
dns_lexicon_add() {
|
|
||||||
fulldomain=$1
|
|
||||||
txtvalue=$2
|
|
||||||
|
|
||||||
domain=$(printf "%s" "$fulldomain" | cut -d . -f 2-999)
|
|
||||||
|
|
||||||
if ! _exists "$lexicon_cmd"; then
|
if ! _exists "$lexicon_cmd"; then
|
||||||
_err "Please install $lexicon_cmd first: $wiki"
|
_err "Please install $lexicon_cmd first: $wiki"
|
||||||
return 1
|
return 1
|
||||||
@ -66,13 +58,36 @@ dns_lexicon_add() {
|
|||||||
eval export "$Lx_domaintoken"
|
eval export "$Lx_domaintoken"
|
||||||
_saveaccountconf "$Lx_domaintoken" "$Lx_domaintoken_v"
|
_saveaccountconf "$Lx_domaintoken" "$Lx_domaintoken_v"
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
######## Public functions #####################
|
||||||
|
|
||||||
|
#Usage: dns_lexicon_add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
|
||||||
|
dns_lexicon_add() {
|
||||||
|
fulldomain=$1
|
||||||
|
txtvalue=$2
|
||||||
|
|
||||||
|
if ! _initLexicon; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
domain=$(printf "%s" "$fulldomain" | cut -d . -f 2-999)
|
||||||
|
|
||||||
$lexicon_cmd "$PROVIDER" create "${domain}" TXT --name="_acme-challenge.${domain}." --content="${txtvalue}"
|
$lexicon_cmd "$PROVIDER" create "${domain}" TXT --name="_acme-challenge.${domain}." --content="${txtvalue}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#fulldomain
|
#Usage: dns_lexicon_rm _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
|
||||||
dns_lexicon_rm() {
|
dns_lexicon_rm() {
|
||||||
fulldomain=$1
|
fulldomain=$1
|
||||||
|
txtvalue=$2
|
||||||
|
|
||||||
|
if ! _initLexicon; then
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
domain=$(printf "%s" "$fulldomain" | cut -d . -f 2-999)
|
||||||
|
|
||||||
|
$lexicon_cmd "$PROVIDER" delete "${domain}" TXT --name="_acme-challenge.${domain}." --content="${txtvalue}"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user