Skip to content

Commit

Permalink
[WIP] the qvm-check conditional isn't doing the trick; as a workaroun…
Browse files Browse the repository at this point in the history
…d, don't abort on qvm-shutdown failure

(cherry picked from commit 9f9d1d3)
  • Loading branch information
cfm authored and zenmonkeykstop committed Mar 22, 2024
1 parent 1103fc2 commit 2c50f7e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions dom0/securedrop-handle-upgrade
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if [[ $TASK == "prepare" ]]; then
BASE_TEMPLATE=$(qvm-prefs sd-app template)
if [[ ! $BASE_TEMPLATE =~ "small-bullseye" ]]; then
if qvm-check --running sd-app; then
qvm-shutdown --wait sd-app
qvm-shutdown --wait sd-app || true
fi
fi
fi
Expand All @@ -32,16 +32,16 @@ if [[ $TASK == "prepare" ]]; then
BASE_TEMPLATE=$(qvm-prefs sd-viewer template)
if [[ ! $BASE_TEMPLATE =~ "large-bullseye" ]]; then
qubes-prefs default_dispvm ''
qvm-shutdown --wait sd-viewer
qvm-shutdown --wait sd-viewer || true
qvm-remove -f sd-viewer
fi
fi

if qvm-check --quiet sd-devices; then
BASE_TEMPLATE=$(qvm-prefs sd-devices-dvm template)
if [[ ! $BASE_TEMPLATE =~ "large-bullseye" ]]; then
qvm-shutdown --wait sd-devices
qvm-shutdown --wait sd-devices-dvm
qvm-shutdown --wait sd-devices || true
qvm-shutdown --wait sd-devices-dvm || true
qvm-remove -f sd-devices
qvm-remove -f sd-devices-dvm
fi
Expand All @@ -53,7 +53,7 @@ if [[ $TASK == "prepare" ]]; then
if qvm-check --quiet sd-proxy; then
BASE_TEMPLATE=$(qvm-prefs sd-proxy template)
if [[ ! $BASE_TEMPLATE =~ "large-bullseye" ]]; then
qvm-shutdown --wait sd-proxy
qvm-shutdown --wait sd-proxy || true
fi
fi

Expand All @@ -63,8 +63,8 @@ if [[ $TASK == "prepare" ]]; then
if qvm-check --quiet sd-whonix; then
BASE_TEMPLATE=$(qvm-prefs sd-whonix template)
if [[ ! $BASE_TEMPLATE =~ "17" ]]; then
qvm-shutdown --wait sd-proxy
qvm-shutdown --wait sd-whonix
qvm-shutdown --wait sd-proxy || true
qvm-shutdown --wait sd-whonix || true
fi
fi

Expand All @@ -84,15 +84,15 @@ if [[ $TASK == "prepare" ]]; then
if qvm-check --quiet sd-gpg; then
BASE_TEMPLATE=$(qvm-prefs sd-gpg template)
if [[ ! $BASE_TEMPLATE =~ "small-bullseye" ]]; then
qvm-shutdown --wait sd-gpg
qvm-shutdown --wait sd-gpg || true
fi
fi

# Shut down sd-log last, since other VMs will autostart it by sending logs
if qvm-check --quiet sd-log; then
BASE_TEMPLATE=$(qvm-prefs sd-log template)
if [[ ! $BASE_TEMPLATE =~ "small-bullseye" ]]; then
qvm-shutdown --wait sd-log
qvm-shutdown --wait sd-log || true
fi
fi
elif [[ $TASK == "remove" ]]; then
Expand All @@ -105,7 +105,7 @@ elif [[ $TASK == "remove" ]]; then
do
if qvm-check "${template}" --quiet; then
if qvm-check --running "${template}"; then
qvm-shutdown --wait "${template}"
qvm-shutdown --wait "${template}" || true
fi
qvm-remove -f "${template}"
fi
Expand Down

0 comments on commit 2c50f7e

Please sign in to comment.