diff --git a/autodist-cgi b/autodist-cgi index 6bdeb7c..04048c4 100755 --- a/autodist-cgi +++ b/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