Commit 65b4badc23a5e3d1770140e7422bc514abc28a80

Authored by gaofengduan
1 parent 4906ebd2

add 重启脚本

#先更新代码和配表到最新
#从main中读取port配置
#若已启动先kill再run
Showing 1 changed file with 17 additions and 0 deletions   Show diff stats
restart.sh 0 → 100755
... ... @@ -0,0 +1,17 @@
  1 +#! /bin/bash -e
  2 +echo "server git pull"
  3 +git pull
  4 +echo "src/csvdata git pull"
  5 +cd src/csvdata
  6 +pwd
  7 +git pull
  8 +cd ../../
  9 +echo "check status"
  10 +port=`cat src/main.lua | grep 'services/ngxd' | sed 's/)//g' | awk '{printf $5}'`
  11 +echo 'prot '$port
  12 +pid=$(lsof -i:$port | grep skynet | awk '{print $2}')
  13 +if [ -n "$pid" ]; then
  14 + echo 'kill old server pid '$pid
  15 + kill -9 $pid
  16 +fi
  17 +skynet/skynet src/config
0 18 \ No newline at end of file
... ...