
正文
Centos7 启动脚本
提示:扫一扫查出行【扫一扫了解最新限行尾号】
复制提示
Centos7 启动脚本
启动脚本、如果进程已存在,输出错误信息后退出;
#! /bin/bash
PIDS=`ps -ef | grep '/usr/bin/node ./index.js' | grep '?' | awk '{print $2}'`
if [ -n "$PIDS" ]; then
echo "ERROR: The index.js (user async service) already started!"
echo "PID: $PIDS"
exit
fi
echo 'start index.js ...'
cd /myservice
./nohup index.js >&>/dev/null &
sleep
str=$"\n"
sstr=$(echo -e $str)
echo $sstr
echo "start index.js success"







