From eb8fc8ea82ff783cdf5ee029ecfec8f60777bb9c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Diemer?= <stephane.diemer@ubicast.eu>
Date: Fri, 16 Jun 2017 16:29:58 +0200
Subject: [PATCH] Check if system is in LXC container for Dell packages.

---
 3.New_server_deployment/5.Dell_openmanage/0_setup.sh | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/3.New_server_deployment/5.Dell_openmanage/0_setup.sh b/3.New_server_deployment/5.Dell_openmanage/0_setup.sh
index 553e5895..272aeb9e 100755
--- a/3.New_server_deployment/5.Dell_openmanage/0_setup.sh
+++ b/3.New_server_deployment/5.Dell_openmanage/0_setup.sh
@@ -7,6 +7,11 @@ if ( ! dpkg -l | grep dmidecode ); then
 fi
 
 if ( dmidecode | grep Dell ); then
+	if ( grep -qa container=lxc /proc/1/environ ); then
+		echo "The system is running in a LXC container, no Dell package will be installed."
+		exit 0
+	fi
+
 	echo 'deb http://linux.dell.com/repo/community/ubuntu xenial openmanage' > /etc/apt/sources.list.d/linux.dell.com.sources.list
 	gpg --keyserver pool.sks-keyservers.net --recv-key 1285491434D8786F
 	gpg -a --export 1285491434D8786F | sudo apt-key add - 
-- 
GitLab