windows: virt-what 可能返回多个结果,因此配合 grep 使用

This commit is contained in:
bin456789 2023-06-05 19:51:55 +08:00
parent a66cbdfb41
commit e68103a4db
No known key found for this signature in database
GPG Key ID: EE301B386DE6C11B

View File

@ -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 ;;