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

19 lines
303 B

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