implement printNotice(), quit() and fix die()

This commit is contained in:
belliash 2012-01-03 14:19:06 +01:00
parent e3edcb53fc
commit 8ac9902ef0
3 changed files with 21 additions and 0 deletions

View File

@ -15,6 +15,9 @@ source ${EZROOT}/libraries/common
loadLibraries
loadConfiguration
# Print EzBuild notice
printNotice
# Check system requirements
printInfo "Checking system prerequisites..."
checkPrerequisites

3
ezsync
View File

@ -15,6 +15,9 @@ source ${EZROOT}/libraries/common
loadLibraries
loadConfiguration
# Print EzBuild notice
printNotice
# Check system requirements
printInfo "Checking system prerequisites..."
checkPrerequisites

View File

@ -58,6 +58,7 @@ function die() {
echo -e "${MESG}\n${LOGS}" | mailx -s "${TOPIC}" "${NOTIFY}"
fi
printError "${1}"
echo -ne "\n"
exit ${2}
}
@ -190,6 +191,15 @@ function printInfo() {
echo -e " ${MESSAGE_INFO} ${@}"
}
#-------------------------------------------------------------------------------
# Outputs formatted information about EzBuild version and copyrights
#-------------------------------------------------------------------------------
function printNotice() {
echo -e "\n${COLOR_BOLD}EzBuild v${EZVERSION} (${EZNAME} launched)"
echo -e "${EZCOPYRIGHT}${COLOR_NORMAL}"
echo -e "${BORDER_STAR}\n"
}
#-------------------------------------------------------------------------------
# Outputs formatted warning to both display and log file
# Parameters: %message%
@ -199,6 +209,11 @@ function printWarn() {
echo -e " ${MESSAGE_WARN} ${@}"
}
function quit() {
echo -e "${COLOR_BOLD}ALL DONE!\n${COLOR_NORMAL}"
exit 0
}
#-------------------------------------------------------------------------------
# Restores original Internal Field Separator (IFS)
#-------------------------------------------------------------------------------