autodist-cgi: check if host is up before fetching cgi data from secondary sites
This commit is contained in:
parent
f6543e78fa
commit
bf3085f435
12
autodist-cgi
12
autodist-cgi
@ -358,10 +358,14 @@ done
|
||||
# only root host (0) calls other hosts
|
||||
if [ "$AS_HOST" = "0" -a ! "$SHOWLOG" ]; then
|
||||
for h in `seq 1 ${#AUTOPORT_CGI_HOST[*]}`; do
|
||||
if [ "$NUM" -a "$HOST" = "$h" ]; then
|
||||
curl "${AUTOPORT_CGI_HOST[$h]}?AS_HOST=$h&LINES=$LINES&NUM=$NUM&REP=$RNUM&HOST=$HOST" 2>/dev/null
|
||||
elif [ ! "$NUM" ]; then
|
||||
curl "${AUTOPORT_CGI_HOST[$h]}?AS_HOST=$h&LINES=$LINES" 2>/dev/null
|
||||
WBHOSTURL=`echo ${AUTOPORT_CGI_HOST[$h]} | sed "s|^\(http[s]*://[^/]*\).*$|\1|"`
|
||||
if [ "$WBHOSTURL" ]; then
|
||||
curl -m1 -s -I ${WBHOSTURL} >/dev/null || continue
|
||||
if [ "$NUM" -a "$HOST" = "$h" ]; then
|
||||
curl "${AUTOPORT_CGI_HOST[$h]}?AS_HOST=$h&LINES=$LINES&NUM=$NUM&REP=$RNUM&HOST=$HOST" 2>/dev/null
|
||||
elif [ ! "$NUM" ]; then
|
||||
curl "${AUTOPORT_CGI_HOST[$h]}?AS_HOST=$h&LINES=$LINES" 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user