modified the container check

This commit is contained in:
iadgovuser26 2023-10-12 15:17:05 +00:00
parent 03ee0bfda8
commit 9bee292bd6

View File

@ -12,7 +12,7 @@ SQL_SERVICE="mariadb"
check_for_container () {
PRINT_STATUS=$1
# Check if we're in a Docker container
if [[ $(cat /proc/1/sched | head -n 1) == *"bash"* ]]; then
if [[ $(cat /proc/1/cgroup | head -n 1) == *"docker"* ]]; then
#if [ -f /.dockerenv ]; then
DOCKER_CONTAINER=true
if [[ $PRINT_STATUS == "-p" ]]; then echo "ACA is running in a container..." | tee -a "$LOG_FILE"; fi