quote output filename

Shouldn't be necessary for output from `mktemp`, but better play it
safe.
This commit is contained in:
Simon Ruderich
2015-12-05 18:07:54 +01:00
parent 2e8454b46e
commit d6d11a75e6

View File

@@ -43,11 +43,11 @@ hex2bin() {
_request() {
temperr="$(mktemp)"
if [ "${1}" = "head" ]; then
curl -sSf -I "${2}" 2>${temperr}
curl -sSf -I "${2}" 2>"${temperr}"
elif [ "${1}" = "get" ]; then
curl -sSf "${2}" 2>${temperr}
curl -sSf "${2}" 2>"${temperr}"
elif [ "${1}" = "post" ]; then
curl -sSf "${2}" -d "${3}" 2>${temperr}
curl -sSf "${2}" -d "${3}" 2>"${temperr}"
fi
if [ ! -z "$(<${temperr})" ]; then echo " + ERROR: An error occured while sending ${1}-request to ${2} ($(<"${temperr}"))" >&2; exit 1; fi
rm -f "${temperr}"