From 01197e7400f6fdfa10f81f03ae981ec2552659d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marta=20Marczykowska-G=C3=B3recka?= Date: Fri, 28 Jul 2023 19:44:18 +0200 Subject: [PATCH] Check if policy files exist --- qubes-dist-upgrade.sh | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/qubes-dist-upgrade.sh b/qubes-dist-upgrade.sh index aac6912..3cf98eb 100755 --- a/qubes-dist-upgrade.sh +++ b/qubes-dist-upgrade.sh @@ -76,10 +76,14 @@ shutdown_nonessential_vms() { mapfile -t running_vms < <(qvm-ls --running --raw-list --fields name) keep_running=( dom0 "$usbvm" "$netvm" "$updatevm" "${extra_keep_running[@]}" ) # all the updates-proxy targets - mapfile -t updates_proxy < <(grep '^\s*[^#].*target=' /etc/qubes-rpc/policy/qubes.UpdatesProxy | cut -d = -f 2) - keep_running+=( "${updates_proxy[@]}" ) - mapfile -t updates_proxy_new < <(grep qubes.UpdatesProxy /etc/qubes/policy.d/*policy | grep '^\s*[^#].*target=' /etc/qubes-rpc/policy/qubes.UpdatesProxy | cut -d = -f 2) - keep_running+=( "${updates_proxy_new[@]}" ) + if [ -e "/etc/qubes-rpc/policy/qubes.UpdatesProxy" ]; then + mapfile -t updates_proxy < <(grep '^\s*[^#].*target=' /etc/qubes-rpc/policy/qubes.UpdatesProxy | cut -d = -f 2) + keep_running+=( "${updates_proxy[@]}" ) + fi + if [ -e "/etc/qubes-rpc/policy/qubes.UpdatesProxy" ]; then + mapfile -t updates_proxy_new < <(grep qubes.UpdatesProxy /etc/qubes/policy.d/*policy | grep '^\s*[^#].*target=' | cut -d = -f 2) + keep_running+=( "${updates_proxy_new[@]}" ) + fi for vm in "${keep_running[@]}" do