use "-s" to detect content in temporary curl error logfile

This commit is contained in:
Lukas Schauer
2015-12-06 15:01:34 +01:00
parent c4be4c695a
commit 96d7eabed4

View File

@@ -55,7 +55,7 @@ _request() {
curl -sSf "${2}" -d "${3}" 2> "${temperr}"
fi
if [[ ! -z "$(<${temperr})" ]]; then
if [[ -s "${temperr}" ]]; then
echo " + ERROR: An error occured while sending ${1}-request to ${2} ($(<"${temperr}"))" >&2
rm -f "${temperr}"
exit 1