checkExist: simplifed logging.

Write directly to logFile instead of tee for warnings and errors.
This commit is contained in:
Asif Bacchus 2018-09-06 02:39:24 -06:00
parent 213210eef4
commit db21064b8a

View File

@ -169,14 +169,12 @@ function checkExist {
return 1
elif [ "$2" = "warn" ]; then
echo -e "\e[1;33m[`date +%Y-%m-%d` `date +%H:%M:%S`] ---WARNING:" \
"${3} was not found---\e[0m" | tee -a $logFileVerbose \
$logFileNormal $logFileQuiet > /dev/null
"${3} was not found---\e[0m" >> $logFile
exitWarning=101
return 2
elif [ "$2" = "error" ]; then
echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] ---ERROR:" \
"${3} was not found---\e[0m" | tee -a $logFileVerbose \
$logFileNormal $logFileQuiet > /dev/null
"${3} was not found---\e[0m" >> $logFile
quit 101
fi
elif [ "$1" = "verify" ]; then
@ -186,8 +184,7 @@ function checkExist {
return 0
else
echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] ---ERROR:" \
"Problem creating ${2}---\e[0m" | tee -a $logFileVerbose \
$logFileNormal $logFileQuiet > /dev/null
"Problem creating ${2}---\e[0m" >> $logFile
quit 102
fi
fi