Edits history of script submission #382 for ' Check if a docker container is running (docker)'

  • bash
    One script reply has been approved by the moderators
    Ap­pro­ved
    container_name="${1:-world}"
    
    # check if the container exists
    if docker ps -a | grep -q "$container_name"; then
      echo "true"
    else
      echo "false"
    fi
    

    Submitted by hugo697 372 days ago

  • bash
    container_name="${1:-world}"
    
    # check if the container exists
    if docker ps -a | grep -q "$container_name"; then
      echo "true"
    else
      echo "false"
    fi
    

    Submitted by yassinsiouda74165 1070 days ago