Skip to content

Commit

Permalink
made webOnline script connect 3 times before reporting error
Browse files Browse the repository at this point in the history
  • Loading branch information
cyclingzealot committed Sep 5, 2018
1 parent ba5ccb1 commit aa528d2
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions webOnline.bash
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,21 @@ fi

for page in `cat $configFile | sort | uniq | sort -R `; do
START=$(date +%s.%N)
TH=10
if ! curl -k -I -fs --max-time $TH $page | head -n 1 ; then
TH=20
connect=false
attempts=0
set -x
while [ $attempts -lt 3 ] && ! $connect ; do
if ! curl -k -I -fs --max-time $TH $page > /dev/null ; then
let "attempts++"
else
connect=true
fi
sleep 1
done


if ! $connect ; then
END=$(date +%s.%N)
DIFF=$(echo "$END - $START" | bc)
sendAlert=1
Expand Down

0 comments on commit aa528d2

Please sign in to comment.