Shell 判断进程是否存在

# 判断是否启动了Redis,仅作为提醒
REDIS_PIDS=$(ps -ef | grep redis | grep -v grep | awk '{print $2}')
if [ "$REDIS_PIDS" = "" ]; then
    Echo_Yellow "Redis is not runing."
    #运行进程
fi

posted @ 2020-06-11 18:23  TBHacker  阅读(1629)  评论(0编辑  收藏  举报