about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--functions7
1 files changed, 2 insertions, 5 deletions
diff --git a/functions b/functions
index 17850e2..037cd08 100644
--- a/functions
+++ b/functions
@@ -28,11 +28,8 @@ emergency_shell() {
 }
 
 detect_virt() {
-   # Detect LXC containers
-   [ ! -e /proc/self/environ ] && return
-   if grep -q lxc /proc/self/environ >/dev/null; then
-       export VIRTUALIZATION=1
-   fi
+   # Detect LXC (and other) containers
+   [ -z "${container+x}" ] || export VIRTUALIZATION=1
 }
 
 deactivate_vgs() {