linux 检测进程

#!/bin/sh

status="`ps -ef |grep "内容" | grep -v grep | wc -l`"
if [ $status -eq 0 ]
then
    cd /home/wwwroot/
    nohup 命令 -d > /dev/null 2>&1 &
    echo '启动成功'
else
    echo '已经启动';
fi
原文地址:https://www.cnblogs.com/chengfengchi/p/14047587.html