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 | |||||
Jon Hall | 880b4e5 | 2017-02-16 16:13:38 -0800 | [diff] [blame] | 11 | for i in {1..5}; do |
12 | curl -f -isS -uonos:rocks ${url} >$aux | ||||
Ray Milkey | 6e968e1 | 2015-09-18 09:55:07 -0700 | [diff] [blame] | 13 | if [ $? = 0 ]; then |
14 | cat $aux | ||||
15 | exit 0 | ||||
16 | fi | ||||
17 | sleep 1 | ||||
18 | done | ||||
19 | |||||
20 | cat $aux | ||||
21 | exit 1 | ||||
22 |