docker start $(docker ps -a | awk '{ print $1}' | tail -n +2)
​
if [[ "$?" != 0 ]] ; then
  time=$(date "+%Y-%m-%d %H:%M:%S")
  echo $time “重新启动了docker service” >> restart_docker_service.log
  service docker start
  docker start $(docker ps -a | awk '{ print $1}' | tail -n +2)
else
  docker start $(docker ps -a | awk '{ print $1}' | tail -n +2)
fi