From e68103a4db9cf1641fb72f7a91245f1419539528 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Mon, 5 Jun 2023 19:51:55 +0800 Subject: [PATCH] =?UTF-8?q?windows:=20virt-what=20=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E8=BF=94=E5=9B=9E=E5=A4=9A=E4=B8=AA=E7=BB=93=E6=9E=9C=EF=BC=8C?= =?UTF-8?q?=E5=9B=A0=E6=AD=A4=E9=85=8D=E5=90=88=20grep=20=E4=BD=BF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- trans.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/trans.sh b/trans.sh index d23f148..2919a65 100644 --- a/trans.sh +++ b/trans.sh @@ -253,7 +253,8 @@ if [ "$distro" = "windows" ]; then mount /os/windows.iso /iso # 下载 virtio 驱动 - if [ "$(virt-what)" = kvm ]; then + # virt-what 可能返回多个结果,因此配合 grep 使用 + if virt-what | grep kvm; then case $(echo "$image_name" | tr '[:upper:]' '[:lower:]') in 'windows server 2022'*) sys=2k22 ;; 'windows server 2019'*) sys=2k19 ;;