perf:失败时重试
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user