From f1a3950c9728dee890703c0a8a0cbd4328ba8035 Mon Sep 17 00:00:00 2001 From: Cameron Nemo Date: Fri, 28 Sep 2018 11:23:01 -0700 Subject: functions/detect_virt: use container env variable Fixes #6 --- functions | 7 ++----- 1 file 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() { -- cgit 1.4.1