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 () {