From 8cfafe5f3b4f71c31113ecf252b9c6535fa37f8f Mon Sep 17 00:00:00 2001 From: Eike Kettner Date: Mon, 4 Jan 2021 17:17:02 +0100 Subject: [PATCH] Fix export-files by checking for header case insensitive --- tools/export-files.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/export-files.sh b/tools/export-files.sh index ce7583e3..6281d5d0 100755 --- a/tools/export-files.sh +++ b/tools/export-files.sh @@ -174,9 +174,9 @@ downloadAttachment() { rm -f "$attachOut" fi - checksum1=$(curl --fail -s -I -H "X-Docspell-Auth: $auth_token" "$ATTACH_URL/$attachId/original" | \ - grep 'ETag' | cut -d' ' -f2 | jq -r) - curl --fail -s -o "$attachOut" -H "X-Docspell-Auth: $auth_token" "$ATTACH_URL/$attachId/original" + checksum1=$(curl -s -I -H "X-Docspell-Auth: $auth_token" "$ATTACH_URL/$attachId/original" | \ + grep -i 'etag' | cut -d' ' -f2 | jq -r) + curl -s -o "$attachOut" -H "X-Docspell-Auth: $auth_token" "$ATTACH_URL/$attachId/original" checksum2=$(sha256sum "$attachOut" | cut -d' ' -f1 | xargs) if [ "$checksum1" == "$checksum2" ]; then errout " - Checksum ok."