debian-mirror-gitlab/scripts/utils.sh

15 lines
209 B
Bash
Raw Normal View History

2017-08-17 22:00:37 +05:30
retry() {
if eval "$@"; then
return 0
fi
for i in 2 1; do
sleep 3s
echo "Retrying $i..."
if eval "$@"; then
return 0
fi
done
return 1
}