unitstatus: unit status cmd is more robust

This commit is contained in:
Motiejus Jakštys 2023-07-28 14:04:23 +03:00
parent 3237810611
commit e9c8320f72

View File

@ -25,7 +25,7 @@
for e in "''${@:2}"; do for e in "''${@:2}"; do
EXTRA+="$e"$'\n' EXTRA+="$e"$'\n'
done done
UNITSTATUS=$(${pkgs.systemd}/bin/systemctl status "$UNIT") UNITSTATUS=$(${pkgs.systemd}/bin/systemctl status "$UNIT" || :)
${pkgs.postfix}/bin/sendmail $MAILTO <<EOF ${pkgs.postfix}/bin/sendmail $MAILTO <<EOF
Subject:Status mail for unit: $UNIT Subject:Status mail for unit: $UNIT