diff --git a/lgsm/functions/alert.sh b/lgsm/functions/alert.sh index e904933c8..c871394a2 100644 --- a/lgsm/functions/alert.sh +++ b/lgsm/functions/alert.sh @@ -6,7 +6,7 @@ lgsm_version="140516" # Description: Overall function for managing alerts. -if [ "${emailalert}" == "on" ]||[ -n "${email}" ]; then +if [ "${emailnotification}" == "on" ]||[ "${emailalert}" == "on" ]&&[ -n "${email}" ]; then alert_email.sh fi diff --git a/lgsm/functions/alert_email.sh b/lgsm/functions/alert_email.sh index 4d84a65a7..8c3d99be9 100644 --- a/lgsm/functions/alert_email.sh +++ b/lgsm/functions/alert_email.sh @@ -39,7 +39,7 @@ fn_details_os(){ echo -e "Hostname: $HOSTNAME" echo -e "tmux: ${tmuxv}" echo -e "GLIBC: ${glibcversion}" - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 } fn_details_performance(){ @@ -63,7 +63,7 @@ fn_details_performance(){ echo -e "Mem: total used free" echo -e "Physical: ${physmemtotal} ${physmemused} ${physmemfree}" echo -e "Swap: ${swaptotal} ${swapused} ${swapfree}" - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 } fn_details_disk(){ @@ -88,7 +88,7 @@ fn_details_disk(){ if [ -d "${backupdir}" ]; then echo -e "Backups: ${backupdirdu}" fi - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 } @@ -165,7 +165,7 @@ fn_details_gameserver(){ else echo -e "Status: ONLINE" fi - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 } fn_alert_email_template_logs(){ @@ -211,7 +211,7 @@ fn_alert_email_template_logs(){ echo "" fi - } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" + } | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"| tee -a "${emaillog}" > /dev/null 2>&1 } fn_print_dots "Sending alert to ${email}" diff --git a/lgsm/functions/command_test_alert.sh b/lgsm/functions/command_test_alert.sh index 81f8be423..4b5e69de4 100644 --- a/lgsm/functions/command_test_alert.sh +++ b/lgsm/functions/command_test_alert.sh @@ -13,7 +13,7 @@ check.sh info_config.sh if [ "${emailalert}" = "on" ]||[ "${pushbulletalert}" = "on" ]; then fn_scriptlog "Sending alert Check" - alertsubject="LGSM - alert Check - ${servername}" + alertsubject="LGSM - Alert Check - ${servername}" alertbody="LGSM testing alert, how you read?" alert.sh else