Advertisement
Guest User

Untitled

a guest
Jan 17th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. while IFS=',' read -r POS HOSTNAME; do
  4.  
  5. if cat checked.csv | grep -q ^$HOSTNAME; then
  6. echo "Skipping $HOSTNAME, already checked."
  7. continue
  8. fi
  9.  
  10. ISWPORG=$(curl -s -L -m 5 $HOSTNAME/readme.html 2>&1 | grep "wordpress.org/support")
  11. ISWPCOM=$(curl -s -L -m 5 --head $HOSTNAME 2>&1 | grep "visit automattic.com/jobs")
  12. ISWPORGCONTENT=$(curl -s -L -m 5 $HOSTNAME 2>&1 > html/$HOSTNAME.txt | grep "/wp-content/")
  13.  
  14. if [[ $ISWPORG || $ISWPCOM || $ISWPORGCONTENT ]]; then
  15. echo "$POS - $HOSTNAME is WP"
  16. echo "$POS,$HOSTNAME" >> topwp.csv
  17. else
  18. echo "$POS - $HOSTNAME is not WP"
  19. fi
  20.  
  21. echo $HOSTNAME >> checked.csv
  22.  
  23. done < top-1m.csv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement