README
[systemd-monitor] / systemd-monitor
1 #!/bin/bash
2
3 function get_state {
4 systemctl show --property=SystemState
5 }
6
7 while [ "$(get_state)" = "SystemState=starting" ]; do
8 sleep 60
9 done
10
11 while [ "$(get_state)" = "SystemState=running" ]; do
12 sleep 60
13 done
14
15 systemctl --failed | mail -s "$(get_state) on $(hostname)" root
16
17 exit 1