2
0
Fork 0

[tests] Fix uploadcheck for BSD (providing sha1 instead of sha1sum)

This commit is contained in:
Stefan Bühler 2013-07-20 10:56:47 +02:00
parent bfa1395937
commit 4cdda3fb1e
1 changed files with 11 additions and 2 deletions

View File

@ -31,9 +31,18 @@ printf '%s' "${val}"
SCRIPT_UPLOADCHECK="""#!/bin/sh
printf 'Status: 200\\r\\nContent-Type: text/plain\\r\\n\\r\\n'
SHA1SUM=$(which sha1sum sha1)
csum=`sha1sum | cut -d' ' -f1`
if [ ! -x "${SHA1SUM}" ]; then
printf 'Status: 404\r\nContent-Type: text/plain\r\n\r\n'
printf "Couldn't find sha1sum nor sha1; can't calculate upload checksum"
echo >&2 "Couldn't find sha1sum nor sha1; can't calculate upload checksum"
exit 1
fi
printf 'Status: 200\r\nContent-Type: text/plain\r\n\r\n'
csum=`"${SHA1SUM}" | cut -d' ' -f1`
printf '%s' "${csum}"
"""