forked from bol-van/zapret
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
virt checks in both install_easy and blockcheck
- Loading branch information
bol-van
committed
Apr 13, 2022
1 parent
341b2ab
commit c6663a5
Showing
3 changed files
with
42 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 </sys/class/dmi/id/product_name | ||
for v in KVM QEMU VMware VMW VirtualBox Xen Bochs Parallels BHYVE Hyper-V; do | ||
case "$s" in | ||
"$v"*) | ||
vm=$v | ||
break | ||
;; | ||
esac | ||
done | ||
fi | ||
;; | ||
esac | ||
echo "$vm" | ||
} | ||
check_virt() | ||
{ | ||
echo \* checking virtualization | ||
local vm=$(get_virt) | ||
if [ -n "$vm" ]; then | ||
if [ "$vm" = "none" ]; then | ||
echo running on bare metal | ||
else | ||
echo "!!! WARNING. $vm virtualization detected !!!" | ||
echo '!!! WARNING. vmware and virtualbox are known to break most of the DPI bypass techniques when network is NATed using internal hypervisor NAT !!!' | ||
echo '!!! WARNING. if this is your case make sure you are bridged not NATed !!!' | ||
fi | ||
else | ||
echo cannot detect | ||
fi | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters