linux中 shell编程 判断服务是否运行

时间:2018-01-03 18:04:47   收藏:0   阅读:186

判断nginx是否运行中:

if ps -ef|grep "nginx"|egrep -v grep >/dev/null
then
        echo ok!
else
        echo no!
fi

原文:https://www.cnblogs.com/DragonStart/p/8184947.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!