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 dockeris startup" >> /tmp/dockerstatus.log
else
echo "$c the dockeris not running" >> /tmp/dockerstatus.log && service docker start
fi
break
done
为什么这样的脚本无法检查当docker不是处于listening时候不会检查到停止了而重新启动进程?
页:
[1]