]>
git.proxmox.com Git - mirror_acme.sh.git/blob - dnsapi/dns_lexicon.sh
3 # dns api wrapper of lexicon for acme.sh
5 # https://github.com/AnalogJ/lexicon
8 wiki
="https://github.com/Neilpang/acme.sh/wiki/How-to-use-lexicon-dns-api"
10 ######## Public functions #####################
12 #Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
17 domain
=$
(printf "%s" "$fulldomain" | cut
-d .
-f 2-999)
19 if ! _exists
"$lexicon_cmd"; then
20 _err
"Please install $lexicon_cmd first: $wiki"
24 if [ -z "$PROVIDER" ]; then
26 _err
"Please define env PROVIDER first: $wiki"
30 _savedomainconf PROVIDER
"$PROVIDER"
33 # e.g. busybox-ash does not know [:upper:]
34 # shellcheck disable=SC2018,SC2019
35 Lx_name
=$
(echo LEXICON_
"${PROVIDER}"_USERNAME |
tr 'a-z' 'A-Z')
36 Lx_name_v
=$
(eval echo \$
"$Lx_name")
37 _secure_debug
"$Lx_name" "$Lx_name_v"
38 if [ "$Lx_name_v" ]; then
39 _saveaccountconf
"$Lx_name" "$Lx_name_v"
40 eval export "$Lx_name"
43 # shellcheck disable=SC2018,SC2019
44 Lx_token
=$
(echo LEXICON_
"${PROVIDER}"_TOKEN |
tr 'a-z' 'A-Z')
45 Lx_token_v
=$
(eval echo \$
"$Lx_token")
46 _secure_debug
"$Lx_token" "$Lx_token_v"
47 if [ "$Lx_token_v" ]; then
48 _saveaccountconf
"$Lx_token" "$Lx_token_v"
49 eval export "$Lx_token"
52 # shellcheck disable=SC2018,SC2019
53 Lx_password
=$
(echo LEXICON_
"${PROVIDER}"_PASSWORD |
tr 'a-z' 'A-Z')
54 Lx_password_v
=$
(eval echo \$
"$Lx_password")
55 _secure_debug
"$Lx_password" "$Lx_password_v"
56 if [ "$Lx_password_v" ]; then
57 _saveaccountconf
"$Lx_password" "$Lx_password_v"
58 eval export "$Lx_password"
61 # shellcheck disable=SC2018,SC2019
62 Lx_domaintoken
=$
(echo LEXICON_
"${PROVIDER}"_DOMAINTOKEN |
tr 'a-z' 'A-Z')
63 Lx_domaintoken_v
=$
(eval echo \$
"$Lx_domaintoken")
64 _secure_debug
"$Lx_domaintoken" "$Lx_domaintoken_v"
65 if [ "$Lx_domaintoken_v" ]; then
66 eval export "$Lx_domaintoken"
67 _saveaccountconf
"$Lx_domaintoken" "$Lx_domaintoken_v"
70 $lexicon_cmd "$PROVIDER" create
"${domain}" TXT --name="_acme-challenge.${domain}." --content="${txtvalue}"