ddns-scripts: Fixup dnspod.cn-v3
authorFriesI23 Qin <FriesI23@outlook.com>
Tue, 14 Jan 2025 06:20:10 +0000 (14:20 +0800)
committerFlorian Eckert <Eckert.Florian@googlemail.com>
Wed, 22 Jan 2025 10:21:46 +0000 (11:21 +0100)
Fix signature expiration issue during retries.

Signed-off-by: FriesI23 Qin <FriesI23@outlook.com>
net/ddns-scripts/Makefile
net/ddns-scripts/files/usr/lib/ddns/update_dnspod_cn_v3.sh

index 55db7fb63578bcf7de1b56fe0e958d93a0473493..cc8a9616eaf2a15f0c9f4e0bef1a935274f93f24 100644 (file)
@@ -8,7 +8,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=ddns-scripts
 PKG_VERSION:=2.8.2
-PKG_RELEASE:=56
+PKG_RELEASE:=57
 
 PKG_LICENSE:=GPL-2.0
 
index fd7124cd4c3209ebb29ef591156050690787acd1..e8dce3d586ddae36ac441fa5a9e3af18290445b2 100644 (file)
@@ -8,6 +8,8 @@
 #      - at: net/ddns-scripts/files/usr/lib/ddns/update_cloudflare_com_v4.sh
 # - github.com/nixonli/ddns-scripts_dnspod for "update_dnspod_cn.sh"
 #
+# v1.1.0: Publish script
+#
 # 2024 FriesI23 <FriesI23@outlook.com>
 #
 # API documentation at https://cloud.tencent.com/document/api/1427/84627
@@ -43,6 +45,10 @@ local __URLBASE="https://$__URLHOST"
 local __METHOD="POST"
 local __CONTENT_TYPE="application/json"
 
+# Build base command to use
+local __PRGBASE="$CURL -RsS -o $DATFILE --stderr $ERRFILE"
+local __PRGEXTA=""
+
 # split __HOST __DOMAIN from $domain
 # given data:
 # @example.com for "domain record"
@@ -58,6 +64,7 @@ tencentcloud_transfer() {
        local __ERR __CODE
 
        while :; do
+               __RUNPROG="$__PRGBASE $($__PRGEXTA)"
                write_log 7 "#> $__RUNPROG"
                eval "$__RUNPROG"
                __ERR=$? # save communication error
@@ -106,9 +113,6 @@ tencentcloud_transfer() {
        return 0
 }
 
-# Build base command to use
-__PRGBASE="$CURL -RsS -o $DATFILE --stderr $ERRFILE"
-
 # force network/interface-device to use for communication
 if [ -n "$bind_network" ]; then
        local __DEVICE
@@ -298,7 +302,7 @@ if [ -n "$record_id" ]; then
        __RECID="$record_id"
 else
        # read record id for A or AAAA record of host.domain.TLD
-       __RUNPROG="$__PRGBASE $(build_describe_record_list_request_param)"
+       __PRGEXTA="build_describe_record_list_request_param"
        # extract zone id
        tencentcloud_transfer || return 1
        __RECID=$(grep -o '"RecordId":[[:space:]]*[0-9]*' $DATFILE | grep -o '[0-9]*' | head -1)
@@ -335,11 +339,11 @@ __DATA=$(grep -o '"Value":\s*"[^"]*' $DATFILE | grep -o '[^"]*$' | head -1)
 
 if [ -z "$__RECID" ]; then
        # create new record if record id not found
-       __RUNPROG="$__PRGBASE $(build_create_record_request_param $__IP $__RECLINE)"
+       __PRGEXTA="build_create_record_request_param $__IP $__RECLINE"
        tencentcloud_transfer || return 1
        return 0
 fi
 
-__RUNPROG="$__PRGBASE $(build_modify_record_request_param $__IP $__RECLINE $__RECID)"
+__PRGEXTA="build_modify_record_request_param $__IP $__RECLINE $__RECID"
 tencentcloud_transfer || return 1
 return