Improve JSON API DirDetails handle type test

This commit is contained in:
Gioacchino Mazzurco 2021-11-04 13:29:32 +01:00
parent d6c4a086f3
commit 53f2891b78
No known key found for this signature in database
GPG Key ID: A1FBCA3872E87051

View File

@ -39,7 +39,15 @@ function tLog()
echo "$mCategory $(date) $@" >&2
}
mReply="$(curl -u "$API_TOKEN" "$API_BASE_URL/rsFiles/requestDirDetails")"
mCmd="curl -u $API_TOKEN $API_BASE_URL/rsFiles/requestDirDetails"
mReply="$($mCmd)"
mCurlRet="$?"
if [ "$mCurlRet" != 0 ]; then
tLog E "$mCmd failed: $mCurlRet '$mReply'"
exit -3
fi
[ "$(echo "$mReply" | jq '.retval')" == "true" ] ||
{