Changed script exit to list all warnings in array variable (code 100)
This commit is contained in:
parent
10f58c4c0a
commit
6ebbb262d5
@ -142,7 +142,7 @@ function quit {
|
|||||||
elif [ "$2" = "warn" ]; then
|
elif [ "$2" = "warn" ]; then
|
||||||
# exit with warning code
|
# exit with warning code
|
||||||
echo -e "\e[1;33m[`date +%Y-%m-%d` `date +%H:%M:%S`]" \
|
echo -e "\e[1;33m[`date +%Y-%m-%d` `date +%H:%M:%S`]" \
|
||||||
"--Script exiting with WARNING (code: $1)--\e[0m" >> $logFile
|
"--Script exiting with WARNING(S) (code: ${exitWarning[*]})--\e[0m" >> $logFile
|
||||||
exit "$1"
|
exit "$1"
|
||||||
else
|
else
|
||||||
# exit with error code
|
# exit with error code
|
||||||
@ -423,9 +423,11 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
## Log completion of script
|
## Log completion of script
|
||||||
echo -e "\e[1;32m[`date +%Y-%m-%d` `date +%H:%M:%S`]" \
|
if [ ${#exitWarning[@]} -gt 0 ]; then
|
||||||
"--Backup operations completed--\e[0m" >> $logFile
|
quit 100 warn
|
||||||
|
else
|
||||||
|
quit
|
||||||
|
fi
|
||||||
|
|
||||||
|
# end of script -- this exit should not be necessary
|
||||||
# Gracefully exit
|
exit 999
|
||||||
exit 0
|
|
Loading…
Reference in New Issue
Block a user