restart.sh
385 Bytes
#! /bin/bash -e
echo "server git pull"
git pull
echo "src/csvdata git pull"
cd src/csvdata
pwd
git pull
cd ../../
echo "check status"
port=`cat src/main.lua | grep 'services/ngxd' | sed 's/)//g' | awk '{printf $5}'`
echo 'prot '$port
pid=$(lsof -i:$port | grep skynet | awk '{print $2}')
if [ -n "$pid" ]; then
echo 'kill old server pid '$pid
kill -9 $pid
fi
skynet/skynet src/config