14 lines
209 B
Bash
14 lines
209 B
Bash
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
|
|
}
|