#!/bin/bash dockerCheckIsRunningForUser() { local type="$1" # Check if Docker is running for the specified user if [[ $type == "rootless" ]]; then local docker_command='docker ps 2>&1' local result=$(dockerCommandRunInstallUser "$docker_command") elif [[ $type == "rooted" ]]; then local docker_command='docker ps 2>&1' local result=$(eval "$docker_command") else echo "Invalid user type specified." fi # Check the result if [[ $result =~ "Cannot connect to the Docker daemon" ]]; then #echo "Docker is not running for the specified user." : else #echo "Docker is running for the specified user." : fi }