change parameters order

This commit is contained in:
belliash 2012-01-12 13:25:29 +01:00
parent 784a617802
commit 71171dc989
1 changed files with 3 additions and 3 deletions

View File

@ -52,7 +52,7 @@ function checkVersion() {
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
function die() { function die() {
local STATUS=${2:-1} local STATUS=${2:-1}
notify "${1}" ${STATUS} notify ${STATUS} "${1}"
printError "${1}" printError "${1}"
echo -ne "\n" echo -ne "\n"
exit ${STATUS} exit ${STATUS}
@ -169,12 +169,12 @@ function logOutput() {
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
# Sends an e-mail notification about occured error # Sends an e-mail notification about occured error
# Parameters: %message% %code% # Parameters: %status% %message%
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
function notify() { function notify() {
if isEnabled ${LOGGING} && isSet NOTIFY && isEnabled ${EZNOTIFY}; then if isEnabled ${LOGGING} && isSet NOTIFY && isEnabled ${EZNOTIFY}; then
local LOGS="Full output from logs:\n\n$(cat ${LOGFILE})" local LOGS="Full output from logs:\n\n$(cat ${LOGFILE})"
local MESG="The ${EZNAME} has failed with code: ${2} and message: ${1}" local MESG="The ${EZNAME} has failed with code: ${1} and message: ${2}"
local TOPIC="The ${EZNAME} process has failed!" local TOPIC="The ${EZNAME} process has failed!"
echo -e "${MESG}\n${LOGS}" | mailx -s "${TOPIC}" "${NOTIFY}" echo -e "${MESG}\n${LOGS}" | mailx -s "${TOPIC}" "${NOTIFY}"
fi fi