首页 > 技术文章 > linux 检测进程

chengfengchi 2020-11-27 13:59 原文

#!/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

 

推荐阅读