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.
riskshell/shell/savePid

18 lines
315 B

4 years ago
#!/bin/sh
4 years ago
#保存应用进程pid
4 years ago
#重试时间
second=5s
4 years ago
while true
do
4 years ago
if [ -z "`findPortPid $1`" ]
4 years ago
then
4 years ago
echo "没有找到端口:$1的pid,$second后重试"
4 years ago
sleep $second
4 years ago
else
4 years ago
echo "端口:$1的pid:`findPortPid $1`"
echo `findPortPid $1`>run.pid
4 years ago
break
fi
done