fi
# send email to notify user
-sendEmail()
-{
-if [ $NOTIFY == true ]; then
- sendemail -f $FROMADDRESS -t $TOADDRESS \
+sendEmail() {
+ if [ $NOTIFY == true ]; then
+ sendemail -f $FROMADDRESS -t $TOADDRESS \
-s $SMTP -xu $SMTPUSERNAME -xp $(echo $SMTPPASSWORD | base64 --decode) -o tls=yes \
-u "albentohandy" -o message-content-type=html -m "$MESSAGE"
-fi
+ fi
}
# add current date in message
-currentDate()
-{
+currentDate() {
MESSAGE="${MESSAGE}$(date +"%Y-%m-%d %H:%M:%S") "
}
# open html, header and body
-openMail()
-{
+openMail() {
MESSAGE="<html>\n \
<head>\n \
<title>albentohandy.sh notify</title>\n \
}
# write message
-addInfo()
-{
+addInfo() {
MESSAGE="${MESSAGE}$1\n"
}
# close body andy html
-closeMail()
-{
+closeMail() {
MESSAGE="${MESSAGE}\n \
</body>\n \
</html>\n"