From c6663a517e47d5cb857bea1d84acea4745a7e38f Mon Sep 17 00:00:00 2001 From: bol-van Date: Wed, 13 Apr 2022 11:47:14 +0300 Subject: [PATCH] virt checks in both install_easy and blockcheck --- blockcheck.sh | 2 ++ common/virt.sh | 39 +++++++++++++++++++++++++++++++++++++++ install_easy.sh | 31 +------------------------------ 3 files changed, 42 insertions(+), 30 deletions(-) create mode 100644 common/virt.sh diff --git a/blockcheck.sh b/blockcheck.sh index 54d94e2..3716ef6 100755 --- a/blockcheck.sh +++ b/blockcheck.sh @@ -9,6 +9,7 @@ ZAPRET_BASE="$EXEDIR" . "$ZAPRET_BASE/common/dialog.sh" . "$ZAPRET_BASE/common/elevate.sh" . "$ZAPRET_BASE/common/fwtype.sh" +. "$ZAPRET_BASE/common/virt.sh" [ -n "$QNUM" ] || QNUM=59780 [ -n "$TPPORT" ] || TPPORT=993 @@ -1005,6 +1006,7 @@ check_system require_root check_prerequisites check_dns +check_virt ask_params PID= diff --git a/common/virt.sh b/common/virt.sh new file mode 100644 index 0000000..bb70cb3 --- /dev/null +++ b/common/virt.sh @@ -0,0 +1,39 @@ +get_virt() +{ + local vm s v UNAME + UNAME=$(uname) + case "$UNAME" in + Linux) + if exists systemd-detect-virt; then + vm=$(systemd-detect-virt --vm) + elif [ -f /sys/class/dmi/id/product_name ]; then + read s