#!/bin/bash if [ -z $1 ]; then echo "Please pass in the name/ID of the container to inspect" exit 1 elif [[ $(sudo docker inspect -f '{{.State.Running}}' $1 2>/dev/null) == 'true' ]]; then echo 1 exit 0 else echo 0 exit 0 fi