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

20 lines
328 B

4 years ago
#!/bin/sh
4 years ago
#保存应用进程pid
4 years ago
echo "findPort $1"
4 years ago
#重试时间
second=5s
4 years ago
while true
do
pid=`findPortPid $1`
4 years ago
if [ `$pid|wc -l` -eq 0 ]
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:$pid"
4 years ago
echo $pid>pid
4 years ago
break
fi
done