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
1a6af5d8
Unverified
Commit
1a6af5d8
authored
May 12, 2019
by
neil
Committed by
GitHub
May 12, 2019
Browse files
Merge pull request #1582 from v0s/pddfixes
Multiple fixes to Yandex DNSAPI plugin
parents
a4b83895
f85348ba
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_yandex.sh
View file @
1a6af5d8
...
...
@@ -16,7 +16,7 @@ dns_yandex_add() {
_PDD_credentials
||
return
1
export
_H1
=
"PddToken:
$PDD_Token
"
_PDD_get_domain
"
$fulldomain
"
_PDD_get_domain
"
$fulldomain
"
||
return
1
_debug
"Found suitable domain in pdd:
$curDomain
"
curData
=
"domain=
${
curDomain
}
&type=TXT&subdomain=
${
curSubdomain
}
&ttl=360&content=
${
txtvalue
}
"
curUri
=
"https://pddimp.yandex.ru/api2/admin/dns/add"
...
...
@@ -30,16 +30,19 @@ dns_yandex_rm() {
_debug
"Calling: dns_yandex_rm() '
${
fulldomain
}
'"
_PDD_credentials
||
return
1
export
_H1
=
"PddToken:
$PDD_Token
"
record_id
=
$(
pdd_get_record_id
"
${
fulldomain
}
"
)
_debug
"Result:
$record_id
"
_PDD_get_domain
"
$fulldomain
"
_PDD_get_domain
"
$fulldomain
"
||
return
1
_debug
"Found suitable domain in pdd:
$curDomain
"
record_id
=
$(
pdd_get_record_id
"
${
fulldomain
}
"
)
_debug
"Result:
$record_id
"
for
rec_i
in
$record_id
;
do
curUri
=
"https://pddimp.yandex.ru/api2/admin/dns/del"
curData
=
"domain=
${
curDomain
}
&record_id=
${
rec
ord
_i
d
}
"
curData
=
"domain=
${
curDomain
}
&record_id=
${
rec_i
}
"
curResult
=
"
$(
_post
"
${
curData
}
"
"
${
curUri
}
"
)
"
_debug
"Result:
$curResult
"
done
}
#################### Private functions below ##################################
...
...
@@ -54,7 +57,7 @@ _PDD_get_domain() {
_debug2
"res1"
"
$res1
"
__found
=
"
$(
echo
"
$res1
"
|
sed
-n
-e
's#.* "found": \([^,]*\),.*#\1#p'
)
"
_debug
"found:
$__found
results on page"
if
[
"
$__found
"
-lt
20
]
;
then
if
[
"
0
$__found
"
-lt
20
]
;
then
_debug
"last page:
$__page
"
__last
=
1
fi
...
...
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