运行脚本

master
pan 4 years ago
parent 9fc1ed1dc8
commit 4f8d97bb21
  1. 21
      run.sh

@ -3,4 +3,23 @@
export PORT=2233
export webClient=http://localhost:5000
nohup yarn start &
function run(){
nohup yarn start &
findPortPid $PORT>$PORT.log
}
if [ -e *.pid ]
then
pid=`stat *.pid|awk 'NR>1{next}{c=$0;gsub(/\D/,"",c);print c}'`
kill -9 pid
if [ $? -eq 0 ]
then
echo 'kill $pid success'
rm -f *.pid
run()
else
echo 'kill $pid error'
else
run()
fi

Loading…
Cancel
Save