summaryrefslogtreecommitdiff
path: root/.tools/retry.sh
diff options
context:
space:
mode:
authorSaulc <lucas@debian>2018-01-13 19:41:26 +0100
committerSaulc <lucas@debian>2018-01-13 19:41:26 +0100
commit4c4f4be30bae96e6cd943de326b1a4b1b841dcd4 (patch)
treea94e0a063e5df2a9f7f84f720982a3bca0c0cf6d /.tools/retry.sh
downloadclientdata-4c4f4be30bae96e6cd943de326b1a4b1b841dcd4.tar.gz
clientdata-4c4f4be30bae96e6cd943de326b1a4b1b841dcd4.tar.bz2
clientdata-4c4f4be30bae96e6cd943de326b1a4b1b841dcd4.tar.xz
clientdata-4c4f4be30bae96e6cd943de326b1a4b1b841dcd4.zip
Initial commit
Diffstat (limited to '.tools/retry.sh')
-rwxr-xr-x.tools/retry.sh15
1 files changed, 15 insertions, 0 deletions
diff --git a/.tools/retry.sh b/.tools/retry.sh
new file mode 100755
index 00000000..aaa50e98
--- /dev/null
+++ b/.tools/retry.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+n=0
+
+while true; do
+ $*
+ if [ "$?" == 0 ]; then
+ exit 0
+ fi
+ if [[ $n -ge 10 ]]; then
+ exit -1
+ fi
+ sleep 5s
+ n=$((n+1))
+done