]> Sergey Matveev's repositories - sgmon.git/blob - helper/http
Cycle through all addresses
[sgmon.git] / helper / http
1 #!/bin/sh -e
2
3 domain=`echo "$1" | cut -d/ -f3 | cut -d: -f1`
4 "$SGMONDIR"/helper/all-addrs $domain | while read addr ; do
5     bad=0
6     curl \
7         --connect-to "::$addr:" \
8         --range 0-100 \
9         --max-time 60 \
10         --verbose "$1" >state/curl-out 2>&1 || bad=1
11     grep -q "$togrep" state/curl-out || bad=1
12     if [ "$bad" -eq 1 ] ; then
13         cat state/curl-out
14         exit 1
15     fi
16 done