added cleanup before exiting in checkExist

This commit is contained in:
Asif Bacchus 2018-09-07 04:17:09 -06:00
parent 1a3cfcb729
commit 2ada11039a
1 changed files with 4 additions and 0 deletions

View File

@ -219,6 +219,8 @@ function checkExist {
elif [ "$2" = "error" ]; then
echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] --ERROR:" \
"${3} was not found--\e[0m" >> $logFile
cleanup 503
cleanup sqlDump
quit 101
else
# file not found, return proper code
@ -232,6 +234,8 @@ function checkExist {
else
echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] --ERROR:" \
"Problem creating ${2}--\e[0m" >> $logFile
cleanUp 503
cleanUp sqlDump
quit 102
fi
else