File docker_service_helper.sh of Package docker

#!/bin/bash

if [ "$1" != "wait" ];then
    echo "Usage $0 option"
    echo "options can be"
    echo "  wait: wait for the daemon to start"
    exit -1
fi

echo "Waiting for docker daemon to start"
for i in {1..60};do
    docker version > /dev/null 2>&1 && break
    sleep 1
done
if docker version > /dev/null 2>&1;then
    echo "Docker is alive"
    exit 0
else
    echo  "Docker is dead"
    exit 1
fi