checkExist: simplifed logging.
Write directly to logFile instead of tee for warnings and errors.
This commit is contained in:
parent
213210eef4
commit
db21064b8a
@ -169,14 +169,12 @@ function checkExist {
|
|||||||
return 1
|
return 1
|
||||||
elif [ "$2" = "warn" ]; then
|
elif [ "$2" = "warn" ]; then
|
||||||
echo -e "\e[1;33m[`date +%Y-%m-%d` `date +%H:%M:%S`] ---WARNING:" \
|
echo -e "\e[1;33m[`date +%Y-%m-%d` `date +%H:%M:%S`] ---WARNING:" \
|
||||||
"${3} was not found---\e[0m" | tee -a $logFileVerbose \
|
"${3} was not found---\e[0m" >> $logFile
|
||||||
$logFileNormal $logFileQuiet > /dev/null
|
|
||||||
exitWarning=101
|
exitWarning=101
|
||||||
return 2
|
return 2
|
||||||
elif [ "$2" = "error" ]; then
|
elif [ "$2" = "error" ]; then
|
||||||
echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] ---ERROR:" \
|
echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] ---ERROR:" \
|
||||||
"${3} was not found---\e[0m" | tee -a $logFileVerbose \
|
"${3} was not found---\e[0m" >> $logFile
|
||||||
$logFileNormal $logFileQuiet > /dev/null
|
|
||||||
quit 101
|
quit 101
|
||||||
fi
|
fi
|
||||||
elif [ "$1" = "verify" ]; then
|
elif [ "$1" = "verify" ]; then
|
||||||
@ -186,8 +184,7 @@ function checkExist {
|
|||||||
return 0
|
return 0
|
||||||
else
|
else
|
||||||
echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] ---ERROR:" \
|
echo -e "\e[1;31m[`date +%Y-%m-%d` `date +%H:%M:%S`] ---ERROR:" \
|
||||||
"Problem creating ${2}---\e[0m" | tee -a $logFileVerbose \
|
"Problem creating ${2}---\e[0m" >> $logFile
|
||||||
$logFileNormal $logFileQuiet > /dev/null
|
|
||||||
quit 102
|
quit 102
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user