#!/bin/bash /usr/sbin/sendmail -t < Subject: $2 failed on $(hostname) Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 $(systemctl status --full "$2") ERRMAIL