diff options
author | Ilya Mashchenko <ilya@netdata.cloud> | 2022-06-13 09:46:31 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-13 09:46:31 +0300 |
commit | b5dcdbe7e87d0e770d07f3f0a155d1f8d145a91d (patch) | |
tree | b64c76825007f0c4451f230fb502f38b9caf6e6d /daemon | |
parent | 6e3144683a73a2024d51425b20ecfd569034c858 (diff) |
fix virtualization detection on FreeBSD (#13087)
Diffstat (limited to 'daemon')
-rwxr-xr-x | daemon/system-info.sh | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/daemon/system-info.sh b/daemon/system-info.sh index 12553e3daa..c1914be790 100755 --- a/daemon/system-info.sh +++ b/daemon/system-info.sh @@ -44,9 +44,11 @@ if [ -z "${VIRTUALIZATION}" ]; then [ -n "$VIRTUALIZATION" ] && VIRT_DETECTION="dmidecode" fi - if [ -z "${VIRTUALIZATION}" ] && [ "${KERNEL_NAME}" = "FreeBSD" ]; then - VIRTUALIZATION=$(sysctl kern.vm_guest 2>/dev/null | cut -d: -f 2 | awk '{$1=$1};1') - [ -n "$VIRTUALIZATION" ] && VIRT_DETECTION="sysctl" + if [ -z "${VIRTUALIZATION}" ] || [ "$VIRTUALIZATION" = "unknown" ]; then + if [ "${KERNEL_NAME}" = "FreeBSD" ]; then + VIRTUALIZATION=$(sysctl kern.vm_guest 2>/dev/null | cut -d: -f 2 | awk '{$1=$1};1') + [ -n "$VIRTUALIZATION" ] && VIRT_DETECTION="sysctl" + fi fi if [ -z "${VIRTUALIZATION}" ]; then |