bundles/pacman: fix unattended-upgrades
This commit is contained in:
parent
1ee0b38133
commit
33d2d5beff
1 changed files with 8 additions and 8 deletions
|
@ -2,17 +2,17 @@
|
||||||
|
|
||||||
set -xeuo pipefail
|
set -xeuo pipefail
|
||||||
|
|
||||||
pacman -Syu
|
pacman -Syu --noconfirm --noprogressbar
|
||||||
|
|
||||||
% for affected, restarts in sorted(restart_triggers.items()):
|
% for affected, restarts in sorted(restart_triggers.items()):
|
||||||
up_since=$(systemctl show "${affected}" | sed -n 's/^ActiveEnterTimestamp=//p' || echo 0)
|
up_since=$(systemctl show "${affected}" | sed -n 's/^ActiveEnterTimestamp=//p' || echo 0)
|
||||||
up_since_ts=$(date -d "$up_since" +%s || echo 0)
|
up_since_ts=$(date -d "$up_since" +%s || echo 0)
|
||||||
now=$(date +%s)
|
now=$(date +%s)
|
||||||
|
|
||||||
if [ $((now - up_since_ts)) -lt 3600 ]
|
if [ $((now - up_since_ts)) -lt 3600 ]
|
||||||
then
|
then
|
||||||
% for restart in sorted(restarts):
|
% for restart in sorted(restarts):
|
||||||
systemctl restart "${restart}" || true
|
systemctl restart "${restart}" || true
|
||||||
% endfor
|
% endfor
|
||||||
fi
|
fi
|
||||||
% endfor
|
% endfor
|
||||||
|
|
Loading…
Reference in a new issue