blob: 97ab8be7574e4a342747c38dce71d3f9b5b6b885 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
|
#!/usr/bin/env bash
set -eux
set -o pipefail
systemctl --no-block start fail-on-restart.service
active_state=$(systemctl show --value --property ActiveState fail-on-restart.service)
while [[ "$active_state" == "activating" || "$active_state" == "active" ]]; do
sleep 1
active_state=$(systemctl show --value --property ActiveState fail-on-restart.service)
done
systemctl is-failed fail-on-restart.service || exit 1
touch /testok
|