Skip to content

Commit

Permalink
trigger the restarter on response code != 200
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Nov 5, 2012
1 parent f0e0f0e commit ce0e151
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions bin/prod/timeout-restarter
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,16 @@ while true; do

sleep $DELAY

curl $URL --max-time $TIMEOUT -so /dev/null
code=$(curl $URL --max-time $TIMEOUT -sL -w "%{http_code}" -o /dev/null)

if [ $? = 0 ]; then
echo -n "."
else
if [[ $? != 0 ]]; then
lilalog "FAIL $MSG"
bin/prod/restart
elif [[ $code != 200 ]]; then
lilalog "CODE $code"
bin/prod/restart
else
echo -n "."
fi

done

0 comments on commit ce0e151

Please sign in to comment.