diff options
author | Cameron Nemo <camerontnorman@gmail.com> | 2018-09-28 11:23:01 -0700 |
---|---|---|
committer | Michael Aldridge <aldridge.mac@gmail.com> | 2022-03-29 21:38:01 -0500 |
commit | f1a3950c9728dee890703c0a8a0cbd4328ba8035 (patch) | |
tree | d141e0df922fc1c5ba1b3a4e19bad2a4b3675252 /functions | |
parent | ad47d4f190175a5690f275175f3b3cd4ed35a095 (diff) | |
download | runit-void-402edaf93d1d882764f18ae2194e86717c84c342.tar.gz runit-void-402edaf93d1d882764f18ae2194e86717c84c342.tar.xz runit-void-402edaf93d1d882764f18ae2194e86717c84c342.zip |
functions/detect_virt: use container env variable 20220329
Fixes #6
Diffstat (limited to 'functions')
-rw-r--r-- | functions | 7 |
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() { |