Shell 判断进程是否存在

CARBON 2020-06-11

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

相关推荐

DiamondTao / 0评论 2020-08-30