From 68f72e2d8c922f476d2faa3f83d6bb6bbed1201a Mon Sep 17 00:00:00 2001 From: Trey Blancher Date: Sat, 19 Aug 2023 10:02:24 -0400 Subject: [PATCH] Fixed mime type of email containing pidstat --- psi-alerts.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/psi-alerts.sh b/psi-alerts.sh index 12f7c0b..c4f2a7e 100755 --- a/psi-alerts.sh +++ b/psi-alerts.sh @@ -109,6 +109,7 @@ send_notice () { } send () { + #set -x if [[ "${#@}" -lt 2 ]] && [[ "${#@}" -gt 3 ]]; then echo "Wrong number of arguments to send()!" >&2 return false @@ -144,7 +145,7 @@ send () { fi # is this an email or SMS? - if [[ ! "${dst}" =~ "${sms_domain}" ]]; then + if [[ ! "${dst}" =~ "@${sms_domain}" ]]; then for p in $(tr '|' ' ' <<< "${current_alarms}"); do printf "\npidstat info for ${p}\n\n" >> ${email} print_pidstat "${p}" >> ${email} @@ -153,10 +154,11 @@ send () { fi # send the message - /usr/bin/mail --resource-files=/ \ + /usr/bin/mail -m ${email} --resource-files=/ \ --subject="${subj}" \ --end-options \ - ${dst} < ${email} + ${dst} + #set +x } is_clear () {