You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
471 B
19 lines
471 B
#!/bin/bash |
|
APP_NAME="qry-python-js" |
|
activate=$1 |
|
if [ "$activate" == "" ]; then |
|
activate=dev |
|
echo "未设置环境变量参数 默认:dev" |
|
fi |
|
|
|
echo "启动环境 $activate" |
|
|
|
#source /usr/share/nvm/init-nvm.sh |
|
nvm use 20 |
|
if pm2 status | grep -q "$APP_NAME.*online"; then |
|
echo "Application $APP_NAME is running." |
|
pm2 restart ecosystem.config.js --env $activate |
|
else |
|
echo "Application $APP_NAME is not running." |
|
pm2 start ecosystem.config.js --env $activate |
|
fi |