From f2e10df14440b0f313cb56457f0604d01535d18a Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Thu, 26 Sep 2024 17:05:48 +0200 Subject: [PATCH] Start virtual network only if available --- .../Common/Software/Virtual Machine Manager/main.fish | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scripts/Common/Software/Virtual Machine Manager/main.fish b/scripts/Common/Software/Virtual Machine Manager/main.fish index f3e01bff..981738bf 100755 --- a/scripts/Common/Software/Virtual Machine Manager/main.fish +++ b/scripts/Common/Software/Virtual Machine Manager/main.fish @@ -4,11 +4,12 @@ begin source "$dir/../../Scripts/software.fish" function configureSW - sudo virsh net-autostart default + begin + sudo virsh net-info default | grep "^Active:\s*yes\$" > /dev/null + end || sudo virsh net-start default - if not sudo virsh net-info default | grep "^Active:\s*yes\$" > /dev/null - sudo virsh net-start default || true - end + and sudo virsh net-autostart default + or true end function userConfig -a name