fixed shellcheck errors

This commit is contained in:
harrim4n 2017-12-23 20:01:22 +01:00
parent 2a77dde6ee
commit ae37de0e65

View file

@ -720,12 +720,11 @@ get_remote_file_size()
SIZE="-b2 bucket wrong-"
return
fi
${B2CMD} authorize-account ${ACC_ID} ${APP_KEY} 2>&1 >/dev/null
if [[ $? -ne 0 ]]; then
if [[ $(${B2CMD} authorize-account "${ACC_ID}" "${APP_KEY}" >/dev/null 2>&1) -ne 0 ]]; then
SIZE="-b2 authentication wrong-"
return
fi
SIZE=$(${B2CMD} ls --long ${BUCKET} | awk '{ print $5 }' | paste -sd+ | bc | numfmt --to=iec)
SIZE=$(${B2CMD} ls --long "${BUCKET}" | awk '{ print $5 }' | paste -sd+ | bc | numfmt --to=iec)
else
SIZE="-b2 not found in PATH-"
fi