Skip to content

Commit 522350a

Browse files
authored
reformat
1 parent e1fe449 commit 522350a

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

net/ddns-scripts/files/usr/lib/ddns/update_aliyun_com.sh

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -124,41 +124,41 @@ found_match=false
124124

125125
# Extract RecordId from parameters
126126
if [ -n "$(echo "${paramEnc}" | grep RecordId)" ]; then
127-
specRecordId=$(echo "$paramEnc" | grep -o 'RecordId=[^&]*' | cut -d'=' -f2)
127+
specRecordId=$(echo "$paramEnc" | grep -o 'RecordId=[^&]*' | cut -d'=' -f2)
128128
fi
129129

130130
# If RecordId is successfully extracted, try to match it
131131
if [ -n "$specRecordId" ]; then
132-
write_log 7 "specRecordId: ${specRecordId}"
133-
idx=1
134-
while json_is_a $idx object
135-
do
136-
json_select $idx
137-
json_get_var tmp RecordId
138-
write_log 7 "The $idx Domain RecordId: ${tmp}"
139-
if [ "$tmp" = "$specRecordId" ]; then
140-
__RECORD_ID=$specRecordId
141-
json_get_var __RECORD_VALUE Value
142-
write_log 7 "The $idx Domain Record Value: ${__RECORD_VALUE}"
143-
found_match=true
132+
write_log 7 "specRecordId: ${specRecordId}"
133+
idx=1
134+
while json_is_a $idx object
135+
do
136+
json_select $idx
137+
json_get_var tmp RecordId
138+
write_log 7 "The $idx Domain RecordId: ${tmp}"
139+
if [ "$tmp" = "$specRecordId" ]; then
140+
__RECORD_ID=$specRecordId
141+
json_get_var __RECORD_VALUE Value
142+
write_log 7 "The $idx Domain Record Value: ${__RECORD_VALUE}"
143+
found_match=true
144144
break
145-
fi
146-
idx=$((idx+1))
147-
json_select ..
148-
done
145+
fi
146+
idx=$((idx+1))
147+
json_select ..
148+
done
149149
fi
150150

151151
# Fallback to default logic if no match found
152152
if [ "$found_match" = false ]; then
153-
write_log 7 "Using default logic to select record"
154-
# If multiple records are found, only use the first one
155-
if [ "$__RECORD_COUNT" -gt 1 ]; then
156-
write_log 4 "WARNING: found multiple records of $__HOST, only use the first one"
157-
fi
158-
json_select 1
159-
# Get the record id of the first DNS record
160-
json_get_var __RECORD_ID RecordId
161-
json_get_var __RECORD_VALUE Value
153+
write_log 7 "Using default logic to select record"
154+
# If multiple records are found, only use the first one
155+
if [ "$__RECORD_COUNT" -gt 1 ]; then
156+
write_log 4 "WARNING: found multiple records of $__HOST, only use the first one"
157+
fi
158+
json_select 1
159+
# Get the record id of the first DNS record
160+
json_get_var __RECORD_ID RecordId
161+
json_get_var __RECORD_VALUE Value
162162
fi
163163

164164
# dont update if the ip has not changed

0 commit comments

Comments
 (0)