perf:失败时重试

This commit is contained in:
2026-06-12 20:28:04 +08:00
parent 74da29e545
commit 1b2cd91d7f
+20 -2
View File
@@ -9,6 +9,24 @@ passwd=$2
base_num=$3 base_num=$3
random_num=$(shuf -i 1-1000 -n 1) random_num=$(shuf -i 1-1000 -n 1)
step=$(( base_num + random_num )) step=$(( base_num + random_num ))
echo `date +"%Y/%m/%d %H:%M:%S"` $acct step =\> $step
curl -s --location --request GET "https://steps.hubp.de/api?account=$acct&password=$passwd&steps=$step"
do_it() {
echo `date +"%Y/%m/%d %H:%M:%S"` $acct step =\> $step
resp=`curl -s --location --request GET "https://steps.hubp.de/api?account=$acct&password=$passwd&steps=$step"`
if echo $resp | grep success ;then
echo 步数修改成功,$resp
return 0
else
echo 步数修改失败,$resp
return 1
fi
}
for i in `seq 0 4`;do
echo try $i times
if do_it;then
exit 0
fi
done