You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
function run(){
|
|
|
|
nohup yarn start &
|
|
|
|
|
|
|
|
while true
|
|
|
|
do
|
|
|
|
pid=`findPortPid $webPort`
|
|
|
|
if [ pid -eq '' ]
|
|
|
|
then
|
|
|
|
echo pid not found!!!
|
|
|
|
sleep 1s
|
|
|
|
else
|
|
|
|
echo "pid is $pid"
|
|
|
|
break
|
|
|
|
done
|
|
|
|
|
|
|
|
touch $pid.log && chmod +x $pid.log
|
|
|
|
}
|
|
|
|
|
|
|
|
if [ -e *.log ]
|
|
|
|
then
|
|
|
|
pid=`stat *.log|awk 'NR>1{next}{c=$0;gsub(/\D/,"",c);print c}'`
|
|
|
|
kill -9 $pid
|
|
|
|
if [ $? -eq 0 ]
|
|
|
|
then
|
|
|
|
echo "kill $pid success"
|
|
|
|
rm -f *.log
|
|
|
|
run
|
|
|
|
else
|
|
|
|
echo "kill $pid error"
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
run
|
|
|
|
fi
|