标签:docker
#!/bin/bash ###检查docker启动启动 c=`date +%F‘ ‘%T` a=`netstat -a |grep docker| awk ‘{print $7}‘` while :; do if [ "$a" == "LISTENING" ] then echo "$c the docker is startup" >> /tmp/dockerstatus.log else echo "$c the docker is not running" >> /tmp/dockerstatus.log && service docker start fi break done
为什么这样的脚本无法检查当docker不是处于listening时候不会检查到停止了而重新启动进程?
本文出自 “Steven一直不放弃” 博客,请务必保留此出处http://wsw26.blog.51cto.com/1442148/1857919
标签:docker
原文地址:http://wsw26.blog.51cto.com/1442148/1857919