From 3008727ce0cf5b382e6c3139a443177191704a1c Mon Sep 17 00:00:00 2001 From: mboelen Date: Tue, 19 Apr 2016 13:56:00 +0200 Subject: [PATCH] Log exit code of upload activities --- include/data_upload | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/data_upload b/include/data_upload index c90a3104..5b28bdb8 100644 --- a/include/data_upload +++ b/include/data_upload @@ -122,8 +122,8 @@ output "Settings file: ${SETTINGS_FILE}" LogText "Command used: ${CURLBINARY}${CURL_OPTIONS} -s -S --data-urlencode "licensekey=${LICENSE_KEY}" --data-urlencode "collector_version=${PROGRAM_VERSION}" ${LICENSE_SERVER_URL} 2> /dev/null" UPLOAD=`${CURLBINARY}${CURL_OPTIONS} -s -S --data-urlencode "licensekey=${LICENSE_KEY}" --data-urlencode "collector_version=${PROGRAM_VERSION}" ${LICENSE_SERVER_URL} 2> /dev/null` EXITCODE=$? + LogText "Exit code: ${EXITCODE}" if [ ${EXITCODE} -gt 0 ]; then - LogText "Exit code: ${EXITCODE}" echo "" echo "${RED}Upload Error${NORMAL}: License could not be checked. See ${LOGFILE} for details." @@ -196,6 +196,7 @@ output "Settings file: ${SETTINGS_FILE}" LogText "Command used: ${CURLBINARY}${CURL_OPTIONS} -s -S --data-urlencode \"data@${REPORTFILE}\" --data-urlencode \"licensekey=${LICENSE_KEY}\" --data-urlencode \"hostid=${HOSTID}\" ${UPLOAD_URL}" UPLOAD=`${CURLBINARY}${CURL_OPTIONS} -s -S --data-urlencode "data@${REPORTFILE}" --data-urlencode "licensekey=${LICENSE_KEY}" --data-urlencode "hostid=${HOSTID}" ${UPLOAD_URL} 2> /dev/null` EXITCODE=$? + LogText "Exit code: ${EXITCODE}" if [ ${EXITCODE} -gt 0 ]; then echo "" echo "${RED}Upload Error${NORMAL}: cURL could not upload data. See ${LOGFILE} for details."