aboutsummaryrefslogtreecommitdiffstats
path: root/bin/realtime-suggestions
diff options
context:
space:
mode:
Diffstat (limited to 'bin/realtime-suggestions')
-rwxr-xr-xbin/realtime-suggestions16
1 files changed, 16 insertions, 0 deletions
diff --git a/bin/realtime-suggestions b/bin/realtime-suggestions
index cc552fe..c5e7355 100755
--- a/bin/realtime-suggestions
+++ b/bin/realtime-suggestions
@@ -2,6 +2,7 @@
set -euo pipefail
+warning="WARNING:"
change="CHANGE:"
info="INFO:"
kernel_config="/proc/config.gz"
@@ -21,6 +22,20 @@ check_kernel_name() {
fi
}
+check_virtualization() {
+ local virt_type=""
+ if command -v systemd-detect-virt >/dev/null 2>&1; then
+ set +e
+ virt_type=$(systemd-detect-virt)
+ set -e
+ if systemd-detect-virt -q; then
+ echo "$change Running in a virtual machine or container (type: ${virt_type}). This is not recommended!"
+ fi
+ else
+ echo "$warning Unable to detect if in a virtual machine."
+ fi
+}
+
check_filesystems() {
local mount_points=()
local mount_point_data=()
@@ -207,6 +222,7 @@ check_for_useful_tools() {
check_kernel_name
check_root
+check_virtualization
check_filesystems
check_groups
check_ulimits