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.
riskcloudmock/run.sh

26 lines
379 B

4 years ago
#!/bin/sh
4 years ago
function run(){
nohup yarn start &
4 years ago
4 years ago
wait
pid=`findPortPid $webPort`
echo "pid is $pid"
4 years ago
touch $pid.log && chmod +x $pid.log
4 years ago
}
4 years ago
if [ -e *.log ]
4 years ago
then
4 years ago
pid=`stat *.log|awk 'NR>1{next}{c=$0;gsub(/\D/,"",c);print c}'`
4 years ago
kill -9 $pid
4 years ago
if [ $? -eq 0 ]
then
4 years ago
echo "kill $pid success"
4 years ago
rm -f *.log
4 years ago
run
4 years ago
else
4 years ago
echo "kill $pid error"
4 years ago
fi
4 years ago
else
4 years ago
run
4 years ago
fi