Skip to content

Commit

Permalink
host-exec: better container detection
Browse files Browse the repository at this point in the history
Signed-off-by: Luca Di Maio <[email protected]>
  • Loading branch information
89luca89 committed Jun 23, 2023
1 parent 67f2720 commit 06c0c68
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion distrobox-host-exec
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 06c0c68

Please sign in to comment.