1, vi test.sh #编辑test.sh文件
2,chmod a+x test.sh #给test.sh可执行权限
3,编写脚本文件
#!/bin/bash
echo ¨================start repo sync===============¨
repo sync -f -j10
while [ $? == 1 ]; do
echo ¨================sync failed, re-sync again=============¨
sleep 3
repo sync -f -j10
done
4,执行命令 sh test.sh