diff --git a/bundles/pacman/files/do-unattended-upgrades b/bundles/pacman/files/do-unattended-upgrades index 79d38aa..a04b5fc 100644 --- a/bundles/pacman/files/do-unattended-upgrades +++ b/bundles/pacman/files/do-unattended-upgrades @@ -2,17 +2,17 @@ set -xeuo pipefail -pacman -Syu +pacman -Syu --noconfirm --noprogressbar % 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) +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 +if [ $((now - up_since_ts)) -lt 3600 ] +then % for restart in sorted(restarts): - systemctl restart "${restart}" || true + systemctl restart "${restart}" || true % endfor - fi +fi % endfor