Skip to content

Commit 8c07af6

Browse files
authored
Merge pull request acmesh-official#5113 from scruel/dev
fix(deploy_dsm): ensure grep get the error code
2 parents 28f438a + cd01104 commit 8c07af6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

deploy/synology_dsm.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ synology_dsm_deploy() {
227227
fi
228228
fi
229229

230-
error_code=$(echo "$response" | grep '"error":' | grep '"code":[0-9]*' | grep -o '[0-9]*')
230+
error_code=$(echo "$response" | grep '"error":' | grep -o '"code":[0-9]*' | grep -o '[0-9]*')
231231
_debug2 error_code "$error_code"
232232
# Account has 2FA-OTP enabled, since error 403 reported.
233233
# https://global.download.synology.com/download/Document/Software/DeveloperGuide/Firmware/DSM/All/enu/Synology_DiskStation_Administration_CLI_Guide.pdf
@@ -262,7 +262,7 @@ synology_dsm_deploy() {
262262
_secure_debug2 SYNO_DEVICE_ID "$SYNO_DEVICE_ID"
263263
fi
264264
fi
265-
error_code=$(echo "$response" | grep '"error":' | grep '"code":[0-9]*' | grep -o '[0-9]*')
265+
error_code=$(echo "$response" | grep '"error":' | grep -o '"code":[0-9]*' | grep -o '[0-9]*')
266266
_debug2 error_code "$error_code"
267267
fi
268268

@@ -325,7 +325,7 @@ synology_dsm_deploy() {
325325
id=$(echo "$response" | sed -n "s/.*\"desc\":\"$escaped_certificate\",\"id\":\"\([^\"]*\).*/\1/p")
326326
_debug2 id "$id"
327327

328-
error_code=$(echo "$response" | grep '"error":' | grep '"code":[0-9]*' | grep -o '[0-9]*')
328+
error_code=$(echo "$response" | grep '"error":' | grep -o '"code":[0-9]*' | grep -o '[0-9]*')
329329
_debug2 error_code "$error_code"
330330
if [ -n "$error_code" ]; then
331331
if [ "$error_code" -eq 105 ]; then

0 commit comments

Comments
 (0)