1. 程式人生 > >linux中 shell編程 判斷服務是否運行

linux中 shell編程 判斷服務是否運行

else gre inux 運行 pre lin log 服務 body

判斷nginx是否運行中:

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

linux中 shell編程 判斷服務是否運行