#!/bin/sh
#Filename: repo_sync.sh
count=0
ret=1
while [ $ret -ne 0 ]
do
#输入参数1,用作同步的线程数
#如果什么参数都不输入,默认线程为4
#usage: ./repo_sync.sh 10
if [ $1 -lt 20 ] && [ $1 -gt 0 ]; then 
        echo "start repo thread is " $1
        repo sync -j$1
else
        echo "use default repo thread 4"
        repo sync -j4
fi

ret=$?
count=$(( $count + 1))
echo "try $count, ret: $ret"
done
echo "try $count, ret: $ret"

 

相关文章:

  • 2017-11-22
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-20
  • 2021-10-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-04
  • 2022-02-07
  • 2022-12-23
相关资源
相似解决方案