urt-service/systemd-send-email

5 lines
98 B
Bash
Executable File

#!/bin/bash
/usr/bin/mail -s "[$HOSTNAME] $2 Failed" $1 <<EOF
$(systemctl status --full "$2")
EOF