Ray Milkey | 6e968e1 | 2015-09-18 09:55:07 -0700 | [diff] [blame] | 1 | #!/bin/bash |
2 | |||||
Jon Hall | fb6009d | 2017-02-15 16:01:17 -0800 | [diff] [blame^] | 3 | aux=/tmp/stc/stc-$$.log |
Ray Milkey | 6e968e1 | 2015-09-18 09:55:07 -0700 | [diff] [blame] | 4 | trap "rm -f $aux 2>/dev/null" EXIT |
5 | |||||
6 | url=$1 | ||||
7 | |||||
8 | |||||
9 | echo curl-with-retry: $* | ||||
10 | |||||
11 | set -x | ||||
12 | for i in {1..3}; do | ||||
13 | curl -f -uonos:rocks ${url} >$aux | ||||
14 | if [ $? = 0 ]; then | ||||
15 | cat $aux | ||||
16 | exit 0 | ||||
17 | fi | ||||
18 | sleep 1 | ||||
19 | done | ||||
20 | |||||
21 | cat $aux | ||||
22 | exit 1 | ||||
23 |