Duckstation/scripts/retry.sh
2023-01-13 22:10:49 +10:00

14 lines
189 B
Bash
Executable file

#!/bin/bash
RETRIES=10
for i in $(seq 1 "$RETRIES"); do
"$@" && break
if [ "$i" == "$RETRIES" ]; then
echo "Command \"$@\" failed after ${RETRIES} retries."
exit 1
fi
done
exit 0