++++++++++++++++++++++++++++++++++++ 

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环境   webhook脚本配置 

#!/bin/bash

 

export NODE_HOME=/usr/bin/node
export PATH=$NODE_HOME/bin:$PATH
echo "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
cd /www/wwwroot/api/nodeApi/
git reset --hard origin/master
git clean -f
git pull
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
pm2 show 0
echo "----------------------------------------------------------------------------"

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-16
  • 2021-06-12
  • 2022-01-30
  • 2022-12-23
  • 2021-08-28
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
相关资源
相似解决方案