is_cloudflare 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. #!/bin/bash
  2. # up to date https://decloudflare.crimeflare.eu.org
  3. #debugging/tracing which instances neeed a second look after daily run
  4. #echo "$1:" $1
  5. echo $1 >> /tmp/debug_cf_output1
  6. #SEARCHY="^"$1"$"
  7. #echo $SEARCHY
  8. #DISK=/mnt/disk4
  9. #SPLIT1=$DISK/data/deCloudflare/cloudflare_users
  10. #SPLIT2=$DISK/data/deCloudflare/cloudflare_inc
  11. #echo $SPLIT
  12. #output=`grep -r -i $SEARCHY $SPLIT1 -r | head -n 1`
  13. #echo $output
  14. #we used to have a local cache of crimeflare's data. Where is it now??
  15. echo curl -X POST -F \'f=$1\' https://karma.crimeflare.eu.org/api/is/cloudflare/
  16. curl -X POST -F 'f='$1 https://karma.crimeflare.eu.org/api/is/cloudflare/ 2>/dev/null > /tmp/cf_result_file
  17. OUTSTRING=`cat /tmp/cf_result_file`
  18. echo "OUTSTRING" $OUTSTRING
  19. if [[ -z $OUTSTRING ]]; then
  20. echo "something went wrong"
  21. exit 2;
  22. fi
  23. if [[ $OUTSTRING == "[false,false]" ]]; then
  24. echo "something went wrong"
  25. exit 3;
  26. fi
  27. if [[ $OUTSTRING == "[true,true]" ]]; then
  28. echo "yes"
  29. exit 0;
  30. fi
  31. if [[ $OUTSTRING == "[true,false]" ]]; then
  32. echo "no"
  33. exit 1;
  34. fi
  35. #if [[ -z $output ]] ; then
  36. #output=`grep -r -i $SEARCHY $SPLIT2 -r | head -n 1`
  37. #if [[ -z $output ]] ; then
  38. #echo "no";
  39. #exit 1;
  40. #fi
  41. #fi
  42. #echo $1 > /tmp/debug_cf_output1
  43. #if [ -z $output ] ; then
  44. #fi
  45. #else
  46. #echo $#
  47. #echo $output
  48. #echo "yes";
  49. #exit 0;
  50. #fi