Logger "Cannot send alert email via $(type -p sendemail) !!!""WARN"
else
Logger "Sent alert mail using sendemail command without attachment.""NOTICE"
return0
@ -343,7 +265,7 @@ function SendAlert {
fi
# If function has not returned 0 yet, assume it's critical that no alert can be sent
Logger "/!\ CRITICAL: Cannot send alert (neither mutt, mail, sendmail nor sendemail found)." "ERROR"# Is not marked critical because execution must continue
Logger "Cannot send alert (neither mutt, mail, sendmail nor sendemail found)." "ERROR"# Is not marked critical because execution must continue
# Delete tmp log file
if[ -f "$ALERT_LOG_FILE"];then
@ -351,6 +273,97 @@ function SendAlert {
fi
}
#### MINIMAL-FUNCTION-SET END ####
function TrapError {
localjob="$0"
localline="$1"
localcode="${2:-1}"
if[$_SILENT -eq 0];then
echo -e " /!\ ERROR in ${job}: Near line ${line}, exit code ${code}"
fi
}
function Spinner {
if[$_SILENT -eq 1];then
return0
fi
case$toggle
in
1)
echo -n " \ "
echo -ne "\r"
toggle="2"
;;
2)
echo -n " | "
echo -ne "\r"
toggle="3"
;;
3)
echo -n " / "
echo -ne "\r"
toggle="4"
;;
*)
echo -n " - "
echo -ne "\r"
toggle="1"
;;
esac
}
function SedStripQuotes {
echo$(echo$1| sed "s/^\([\"']\)\(.*\)\1\$/\2/g")
}
function StripSingleQuotes {
localstring="${1}"
string="${string/#\'/}"# Remove singlequote if it begins string
string="${string/%\'/}"# Remove singlequote if it ends string
Logger "Cannot send alert email via $(type -p sendemail) !!!""WARN"
else
Logger "Sent alert mail using sendemail command without attachment.""NOTICE"
return0
@ -330,7 +252,7 @@ function SendAlert {
fi
# If function has not returned 0 yet, assume it's critical that no alert can be sent
Logger "/!\ CRITICAL: Cannot send alert (neither mutt, mail, sendmail nor sendemail found)." "ERROR"# Is not marked critical because execution must continue
Logger "Cannot send alert (neither mutt, mail, sendmail nor sendemail found)." "ERROR"# Is not marked critical because execution must continue
# Delete tmp log file
if[ -f "$ALERT_LOG_FILE"];then
@ -338,6 +260,97 @@ function SendAlert {
fi
}
#### MINIMAL-FUNCTION-SET END ####
function TrapError {
localjob="$0"
localline="$1"
localcode="${2:-1}"
if[$_SILENT -eq 0];then
echo -e " /!\ ERROR in ${job}: Near line ${line}, exit code ${code}"
fi
}
function Spinner {
if[$_SILENT -eq 1];then
return0
fi
case$toggle
in
1)
echo -n " \ "
echo -ne "\r"
toggle="2"
;;
2)
echo -n " | "
echo -ne "\r"
toggle="3"
;;
3)
echo -n " / "
echo -ne "\r"
toggle="4"
;;
*)
echo -n " - "
echo -ne "\r"
toggle="1"
;;
esac
}
function SedStripQuotes {
echo$(echo$1| sed "s/^\([\"']\)\(.*\)\1\$/\2/g")
}
function StripSingleQuotes {
localstring="${1}"
string="${string/#\'/}"# Remove singlequote if it begins string
string="${string/%\'/}"# Remove singlequote if it ends string
Logger "Cannot send alert email via $(type -p sendemail) !!!""WARN"
else
Logger "Sent alert mail using sendemail command without attachment.""NOTICE"
return0
@ -331,7 +254,7 @@ function SendAlert {
fi
# If function has not returned 0 yet, assume it's critical that no alert can be sent
Logger "/!\ CRITICAL: Cannot send alert (neither mutt, mail, sendmail nor sendemail found)." "ERROR"# Is not marked critical because execution must continue
Logger "Cannot send alert (neither mutt, mail, sendmail nor sendemail found)." "ERROR"# Is not marked critical because execution must continue
# Delete tmp log file
if[ -f "$ALERT_LOG_FILE"];then
@ -339,6 +262,96 @@ function SendAlert {
fi
}
#### MINIMAL-FUNCTION-SET END ####
function TrapError {
localjob="$0"
localline="$1"
localcode="${2:-1}"
if[$_SILENT -eq 0];then
echo -e " /!\ ERROR in ${job}: Near line ${line}, exit code ${code}"
fi
}
function Spinner {
if[$_SILENT -eq 1];then
return0
fi
case$toggle
in
1)
echo -n " \ "
echo -ne "\r"
toggle="2"
;;
2)
echo -n " | "
echo -ne "\r"
toggle="3"
;;
3)
echo -n " / "
echo -ne "\r"
toggle="4"
;;
*)
echo -n " - "
echo -ne "\r"
toggle="1"
;;
esac
}
function SedStripQuotes {
echo$(echo$1| sed "s/^\([\"']\)\(.*\)\1\$/\2/g")
}
function StripSingleQuotes {
localstring="${1}"
string="${string/#\'/}"# Remove singlequote if it begins string
string="${string/%\'/}"# Remove singlequote if it ends string