Franziska Kunsmann
60c31d2d11
Some checks failed
kunsi/bundlewrap/pipeline/head There was a failure building this commit
18 lines
435 B
Bash
18 lines
435 B
Bash
#!/bin/bash
|
|
|
|
set -xeuo pipefail
|
|
|
|
pacman -Syu
|
|
|
|
% for affected, restarts in sorted(restart_triggers.items()):
|
|
up_since=$(systemctl show "${affected}" | sed -n 's/^ActiveEnterTimestamp=//p' || echo 0)
|
|
up_since_ts=$(date -d "$up_since" +%s || echo 0)
|
|
now=$(date +%s)
|
|
|
|
if [ $((now - up_since_ts)) -lt 3600 ]
|
|
then
|
|
% for restart in sorted(restarts):
|
|
systemctl restart "${restart}" || true
|
|
% endfor
|
|
fi
|
|
% endfor
|