2020-03-04 10:35:06 +01:00
|
|
|
#!/usr/bin/env bash
|
2017-11-16 15:58:11 +01:00
|
|
|
set -ex
|
|
|
|
set -o pipefail
|
|
|
|
|
|
|
|
systemd-run --wait -p FailureAction=poweroff true
|
|
|
|
! systemd-run --wait -p SuccessAction=poweroff false
|
|
|
|
|
2019-07-22 19:47:47 +02:00
|
|
|
if ! test -f /firstphase ; then
|
2017-11-16 15:58:11 +01:00
|
|
|
echo OK > /firstphase
|
|
|
|
systemd-run --wait -p SuccessAction=reboot true
|
|
|
|
else
|
|
|
|
echo OK > /testok
|
|
|
|
systemd-run --wait -p FailureAction=poweroff false
|
|
|
|
fi
|
|
|
|
|
|
|
|
sleep infinity
|