mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-12-26 15:02:03 +00:00
remove python
This commit is contained in:
parent
9ec54ef89b
commit
266e9d0619
@ -31,6 +31,7 @@ dns_yandex_rm() {
|
|||||||
_PDD_credentials || exit 1
|
_PDD_credentials || exit 1
|
||||||
export _H1="PddToken: $PDD_Token"
|
export _H1="PddToken: $PDD_Token"
|
||||||
record_id=$(pdd_get_record_id "${fulldomain}")
|
record_id=$(pdd_get_record_id "${fulldomain}")
|
||||||
|
_debug "Result: $record_id"
|
||||||
|
|
||||||
curDomain="$(echo "${fulldomain}" | rev | cut -d . -f 1-2 | rev)"
|
curDomain="$(echo "${fulldomain}" | rev | cut -d . -f 1-2 | rev)"
|
||||||
curSubdomain="$(echo "${fulldomain}" | rev | cut -d . -f 3- | rev)"
|
curSubdomain="$(echo "${fulldomain}" | rev | cut -d . -f 3- | rev)"
|
||||||
@ -54,16 +55,10 @@ _PDD_credentials() {
|
|||||||
|
|
||||||
pdd_get_record_id() {
|
pdd_get_record_id() {
|
||||||
fulldomain="${1}"
|
fulldomain="${1}"
|
||||||
curDomain="$(echo "${fulldomain}" | awk -F. '{printf("%s.%s\n",$(NF-1), $NF)}')"
|
curDomain="$(echo "${fulldomain}" | rev | cut -d . -f 1-2 | rev)"
|
||||||
|
curSubdomain="$(echo "${fulldomain}" | rev | cut -d . -f 3- | rev)"
|
||||||
curUri="https://pddimp.yandex.ru/api2/admin/dns/list?domain=${curDomain}"
|
curUri="https://pddimp.yandex.ru/api2/admin/dns/list?domain=${curDomain}"
|
||||||
curResult="$(_get "${curUri}")"
|
curResult="$(_get "${curUri}" | _normalizeJson)"
|
||||||
echo "${curResult}" \
|
_debug "Result: $curResult"
|
||||||
| python -c "
|
echo "$curResult" | grep -o "{[^{]*\"content\":[^{]*\"subdomain\":\"${curSubdomain}\"" | sed -n -e 's#.* "record_id": \(.*\),[^,]*#\1#p'
|
||||||
import sys, json;
|
|
||||||
rs=json.load(sys.stdin)[\"records\"]
|
|
||||||
for r in rs:
|
|
||||||
if r[\"fqdn\"]==\"${fulldomain}\":
|
|
||||||
print r[\"record_id\"]
|
|
||||||
exit
|
|
||||||
"
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user