mirror of https://github.com/CISOfy/lynis.git
No error display when file is uploaded and exit code is 0
This commit is contained in:
parent
3ae5c61839
commit
e6d7da4885
|
@ -112,14 +112,12 @@ output "Settings file: ${SETTINGS_FILE}"
|
|||
output "${WHITE}Found hostid: ${HOSTID}${NORMAL}"
|
||||
# Try to connect
|
||||
output "Uploading data.."
|
||||
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}`
|
||||
UPLOAD_CODE=`echo ${UPLOAD} | head -n 1 | awk '{ print $2 }'`
|
||||
output "Output code from upload: ${UPLOAD_CODE}"
|
||||
if [ "${UPLOAD_CODE}" = "100" ]; then
|
||||
output "${GREEN}Data uploaded successfully${NORMAL}"
|
||||
else
|
||||
echo "${RED}Error occured, please check documentation for code ${UPLOAD_CODE}.${NORMAL}"
|
||||
echo "Command used: ${CURLBINARY} ${CURL_OPTIONS} -s -S --data-urlencode \"data@${REPORTFILE}\" --data-urlencode \"licensekey=${LICENSE_KEY}\" --data-urlencode \"hostid=${HOSTID}\" ${UPLOAD_URL}"
|
||||
if [ $? -gt 0 ]; then
|
||||
#UPLOAD_CODE=`echo ${UPLOAD} | head -n 1 | awk '{ print $2 }'`
|
||||
#output "Output code from upload: ${UPLOAD_CODE}"
|
||||
output "${RED}Error occurred, please check documentation for code ${UPLOAD_CODE}.${NORMAL}"
|
||||
output "Debug:"
|
||||
output ${UPLOAD}
|
||||
# Quit
|
||||
|
|
Loading…
Reference in New Issue