Cooler incrementation of the FAIL counter
[einar-bin] / imgurgame.bash
index 66bbe4e33301e7a26f11775ce428873f4d6f9613..d1f9fdd4688594de2bccd1dce5689d2e746d1550 100755 (executable)
@@ -15,7 +15,7 @@ imgururl() {
 testimgur() {
   local URL=${1}
   local RESULT=$(curl -s -o /dev/null -I -w "%{http_code}" ${URL})
 testimgur() {
   local URL=${1}
   local RESULT=$(curl -s -o /dev/null -I -w "%{http_code}" ${URL})
-  if [[ ${RESULT} == 200 ]]; then
+  if [[ ${RESULT} == "200" ]]; then
     echo true
   else
     echo false
     echo true
   else
     echo false
@@ -31,7 +31,7 @@ main() {
       ${BROWSER} ${URL} > /dev/null 2>&1
       local FAIL=0
     else
       ${BROWSER} ${URL} > /dev/null 2>&1
       local FAIL=0
     else
-      FAIL=$(( ${FAIL}+1 ))
+      ((FAIL++))
     fi
   done
 }
     fi
   done
 }