Suppress Error messages on VM check

This commit is contained in:
Suhail Haris 2023-01-21 17:42:38 +05:30
commit bb64ea8c2b
No known key found for this signature in database
GPG key ID: 8E225274EDCBF899

View file

@ -82,11 +82,11 @@ check_virt() {
sys_product="" sys_product=""
sys_ver="" sys_ver=""
fi fi
if grep -qa docker /proc/1/cgroup; then if grep -qa docker /proc/1/cgroup 2>/dev/null; then
VIRT="Docker" VIRT="Docker"
elif grep -qa lxc /proc/1/cgroup; then elif grep -qa lxc /proc/1/cgroup 2>/dev/null; then
VIRT="LXC" VIRT="LXC"
elif grep -qa container=lxc /proc/1/environ; then elif grep -qa container=lxc /proc/1/environ 2>/dev/null; then
VIRT="LXC" VIRT="LXC"
elif [[ -f /proc/user_beancounters ]]; then elif [[ -f /proc/user_beancounters ]]; then
VIRT="OpenVZ" VIRT="OpenVZ"
@ -123,7 +123,7 @@ check_virt() {
fi fi
fi fi
else else
VIRT="Dedicated" VIRT="Dedicated/Unknown"
fi fi
} }