shell脚本启动node服务

#!/bin/bash

cd /root/dev-web


source /etc/profile

/usr/local/node-8.11.1/bin/npm i &&   EGG_SERVER_ENV=dev npm run devstart 

sleep 5
nodeport=` netstat -lntp|grep "7000"|awk '{print $4}'|awk -F":" '{print $4}'`
echo $nodeport

if [ "$nodeport" ];then
          echo -e "\033[32m[ node process start success on dev env !  ]\033[0m"
   
fi

  

posted @ 2018-12-25 11:30  Oops!#  阅读(1773)  评论(0编辑  收藏  举报