Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- upgraded_md5="5e52e622b9d884d873060a00b431ce8e"
- prefix='define("DB_NAME", "'
- suffix='");'
- sqluser=""
- sqlpass=
- folder=$1
- for D in $(ls $1); do
- D=${folder}/${D}
- #echo ${D}
- if [ -d "${D}" ]; then
- if [ -f "${D}/httpdocs/include_babylone/plugins/recaptchalib.php" ]; then
- #echo "Babylone trouvé"
- md5=`md5sum "${D}/httpdocs/include_babylone/plugins/recaptchalib.php" | awk '{print $1}'`
- if [ "$md5" != "$upgraded_md5" ]; then
- #echo "${D} semble avoir une version antérieure de Recaptcha installée"
- bdd=`cat ${D}/httpdocs/include_babylone/variables.php | grep 'define("DB_NAME'`
- bdd=${bdd#$prefix}
- bdd=${bdd%$suffix}
- useRecaptcha=false
- bdd=${bdd/\");/}
- bdd=${bdd//$'\015'}
- while read -r line; do
- #sleep 1
- id_formulaire=$(echo ${line} | awk '{print $1}')
- id_article=$(echo ${line} | awk '{print $2}')
- liste_champs=$(echo ${line} | awk '{$1=$2=""; print $0}')
- if [[ "$liste_champs" == *oui ]]
- then
- useRecaptcha=true
- fi
- done< <(mysql ${bdd} -u${sqluser} -p${sqlpass} -se "SELECT id_formulaire, id_article, liste_champs FROM bab_formulaire;")
- if [ "$useRecaptcha" = true ]; then
- echo "${D} semble ne pas être à jour"
- else
- echo "${D} semble ne pas être à jour mais ne semble pas utiliser Recaptcha"
- fi
- fi
- fi
- fi
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement