linux 判断某个进程是否存在,存在则重启,不存在则启动。 ++++++++++++++++++++ PIDS=`ps -ef|grep "app.js"|grep -v grep` if [ "$PIDS" != "" ]; then pm2 restart app echo "app restart!" else pm2 start app.js echo "app started" fi ++++++++++++++++++++ ## 下面是node...