Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
8d230dd7
Commit
8d230dd7
authored
Jul 24, 2018
by
Old?ich Jedli?ka
Committed by
Oldřich Jedlička
Jul 24, 2018
Browse files
Added dns_lexicon_rm command.
Remove created TXT record when finished. Works with lexicon version 2.3.0 and later.
parent
411b342a
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_lexicon.sh
View file @
8d230dd7
...
@@ -7,15 +7,7 @@ lexicon_cmd="lexicon"
...
@@ -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() {
...
@@ -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
}
"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment