From 06c0c68678fc16918951b8404beb79f338e2842e Mon Sep 17 00:00:00 2001 From: Luca Di Maio Date: Fri, 23 Jun 2023 19:30:22 +0200 Subject: [PATCH] host-exec: better container detection Signed-off-by: Luca Di Maio --- distrobox-host-exec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/distrobox-host-exec b/distrobox-host-exec index 3fd2ad20a9..1cd56f0173 100755 --- a/distrobox-host-exec +++ b/distrobox-host-exec @@ -116,7 +116,7 @@ if [ "${verbose}" -ne 0 ]; then fi # Check we're running inside a container and not on the host -if [ ! -f /run/.containerenv ] && [ ! -f /.dockerenv ]; then +if [ -z "${CONTAINER_ID}" ]; then printf >&2 "You must run %s inside a container!\n" " $(basename "$0")" exit 126 fi