From d66d41ed9a9b260b1bd4795d7db082fb0780fb3e Mon Sep 17 00:00:00 2001 From: Rohan Barar Date: Thu, 4 Sep 2025 18:55:12 +1000 Subject: [PATCH] Fixed #697 and #638 using a more robust string comparison Signed-off-by: Rohan Barar --- setup.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/setup.sh b/setup.sh index d514bcc..ed14cb8 100755 --- a/setup.sh +++ b/setup.sh @@ -838,16 +838,13 @@ function waCheckVMRunning() { # Print feedback. echo -n "Checking the status of the Windows VM... " - # Declare variables. - local VM_STATE="" # Stores the state of the Windows VM. - # Obtain VM Status VM_PAUSED=0 - virsh list --state-paused | grep -wq "$VM_NAME" || VM_PAUSED="$?" + virsh list --state-paused --name | grep -Fxq "$VM_NAME" || VM_PAUSED="$?" VM_RUNNING=0 - virsh list --state-running | grep -wq "$VM_NAME" || VM_RUNNING="$?" + virsh list --state-running --name | grep -Fxq "$VM_NAME" || VM_RUNNING="$?" VM_SHUTOFF=0 - virsh list --state-shutoff | grep -wq "$VM_NAME" || VM_SHUTOFF="$?" + virsh list --state-shutoff --name | grep -Fxq "$VM_NAME" || VM_SHUTOFF="$?" if [[ $VM_SHUTOFF == "0" ]]; then # Complete the previous line.