fix(deploy_dsm): missing gerp -P option on busybox

Fixes:  #5105
pull/5111/head
Scruel Tao 7 months ago committed by GitHub
parent 43b5ea801f
commit 9ff89b570f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -227,7 +227,8 @@ synology_dsm_deploy() {
fi fi
fi fi
error_code=$(echo "$response" | grep '"error"' | grep -oP '(?<="code":)\d+') error_code=$(echo "$response" | grep '"error":' | grep '"code":[0-9]*' | grep -o '[0-9]*')
_debug2 error_code "$error_code"
# Account has 2FA-OTP enabled, since error 403 reported. # Account has 2FA-OTP enabled, since error 403 reported.
# https://global.download.synology.com/download/Document/Software/DeveloperGuide/Firmware/DSM/All/enu/Synology_DiskStation_Administration_CLI_Guide.pdf # https://global.download.synology.com/download/Document/Software/DeveloperGuide/Firmware/DSM/All/enu/Synology_DiskStation_Administration_CLI_Guide.pdf
if [ "$error_code" == "403" ]; then if [ "$error_code" == "403" ]; then
@ -261,7 +262,8 @@ synology_dsm_deploy() {
_secure_debug2 SYNO_DEVICE_ID "$SYNO_DEVICE_ID" _secure_debug2 SYNO_DEVICE_ID "$SYNO_DEVICE_ID"
fi fi
fi fi
error_code=$(echo "$response" | grep '"error"' | grep -oP '(?<="code":)\d+') error_code=$(echo "$response" | grep '"error":' | grep '"code":[0-9]*' | grep -o '[0-9]*')
_debug2 error_code "$error_code"
fi fi
if [ -n "$error_code" ]; then if [ -n "$error_code" ]; then
@ -323,7 +325,8 @@ synology_dsm_deploy() {
id=$(echo "$response" | sed -n "s/.*\"desc\":\"$escaped_certificate\",\"id\":\"\([^\"]*\).*/\1/p") id=$(echo "$response" | sed -n "s/.*\"desc\":\"$escaped_certificate\",\"id\":\"\([^\"]*\).*/\1/p")
_debug2 id "$id" _debug2 id "$id"
error_code=$(echo "$response" | grep '"error"' | grep -oP '(?<="code":)\d+') error_code=$(echo "$response" | grep '"error":' | grep '"code":[0-9]*' | grep -o '[0-9]*')
_debug2 error_code "$error_code"
if [ -n "$error_code" ]; then if [ -n "$error_code" ]; then
if [ "$error_code" -eq 105 ]; then if [ "$error_code" -eq 105 ]; then
_err "Current user is not administrator and does not have sufficient permission for deploying." _err "Current user is not administrator and does not have sufficient permission for deploying."

Loading…
Cancel
Save