Advertisement
Guest User

Untitled

a guest
Jun 27th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. upgraded_md5="5e52e622b9d884d873060a00b431ce8e"
  4. prefix='define("DB_NAME", "'
  5. suffix='");'
  6. sqluser=""
  7. sqlpass=
  8. folder=$1
  9. for D in $(ls $1); do
  10. D=${folder}/${D}
  11. #echo ${D}
  12. if [ -d "${D}" ]; then
  13. if [ -f "${D}/httpdocs/include_babylone/plugins/recaptchalib.php" ]; then
  14. #echo "Babylone trouvé"
  15. md5=`md5sum "${D}/httpdocs/include_babylone/plugins/recaptchalib.php" | awk '{print $1}'`
  16. if [ "$md5" != "$upgraded_md5" ]; then
  17. #echo "${D} semble avoir une version antérieure de Recaptcha installée"
  18. bdd=`cat ${D}/httpdocs/include_babylone/variables.php | grep 'define("DB_NAME'`
  19. bdd=${bdd#$prefix}
  20. bdd=${bdd%$suffix}
  21. useRecaptcha=false
  22. bdd=${bdd/\");/}
  23. bdd=${bdd//$'\015'}
  24. while read -r line; do
  25. #sleep 1
  26. id_formulaire=$(echo ${line} | awk '{print $1}')
  27. id_article=$(echo ${line} | awk '{print $2}')
  28. liste_champs=$(echo ${line} | awk '{$1=$2=""; print $0}')
  29. if [[ "$liste_champs" == *oui ]]
  30. then
  31. useRecaptcha=true
  32. fi
  33. done< <(mysql ${bdd} -u${sqluser} -p${sqlpass} -se "SELECT id_formulaire, id_article, liste_champs FROM bab_formulaire;")
  34. if [ "$useRecaptcha" = true ]; then
  35. echo "${D} semble ne pas être à jour"
  36. else
  37. echo "${D} semble ne pas être à jour mais ne semble pas utiliser Recaptcha"
  38. fi
  39. fi
  40. fi
  41. fi
  42. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement