change parameters order
This commit is contained in:
parent
784a617802
commit
71171dc989
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue