Skip to content

优化ID判断逻辑,以支持大于32位有限符号整数的情况(BusyBox 32bit) - #151

Open
Gnail89 wants to merge 2 commits into
rehiy:v6.1.xfrom
Gnail89:v6.1.x_20250813
Open

优化ID判断逻辑,以支持大于32位有限符号整数的情况(BusyBox 32bit)#151
Gnail89 wants to merge 2 commits into
rehiy:v6.1.xfrom
Gnail89:v6.1.x_20250813

Conversation

@Gnail89

@Gnail89 Gnail89 commented Aug 13, 2025

Copy link
Copy Markdown

in v6.1.x

@@ -138,7 +138,7 @@ arDdnsIds() {
domainId=$(arDdnsApi "Domain.Info" "domain=$2")
domainId=$(echo $domainId | sed 's/."id":"([0-9])".*/\1/')

- if ! [ "$domainId" -gt 0 ] 2>/dev/null ;then
+ if [ "$(echo "$domainId 0" |awk '{print ($1 > $2)}')" -eq 0 ] 2>/dev/null ;then
errMsg=$(echo $domainId | sed 's/."message":"([^\"])"./\1/')
echo "arDdnsIds - $errMsg"
return 1
@@ -148,7 +148,7 @@ arDdnsIds() {
recordId=$(arDdnsApi "Record.List" "domain_id=$domainId&sub_domain=$3&record_type=$1")
recordId=$(echo $recordId | sed 's/.
"id":"([0-9])"./\1/')

- if ! [ "$recordId" -gt 0 ] 2>/dev/null ;then
+ if [ "$(echo "$recordId 0" |awk '{print ($1 > $2)}')" -eq 0 ] 2>/dev/null ;then
errMsg=$(echo $recordId | sed 's/."message":"([^\"])".*/\1/')
echo "arDdnsIds - $errMsg"
return 1

@Gnail89
Gnail89 changed the base branch from master to v6.1.x August 13, 2025 05:51
@Gnail89

Gnail89 commented Mar 11, 2026

Copy link
Copy Markdown
Author

使用dnspod获取recordId可能超过int长度,导致脚本中recordId判断条件执行失败,建议将if ! [ "$recordId" -gt 0 ] 2>/dev/null ;then 更新为 if [ "$(echo "$recordId 0" |awk '{print ($1 > $2)}')" -eq 0 ] 2>/dev/null ;then,使用awk命令判断超过长度的recordId。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant