Skip to content

Instantly share code, notes, and snippets.

@mikedugan
Created February 7, 2014 20:32
Show Gist options
  • Select an option

  • Save mikedugan/8871197 to your computer and use it in GitHub Desktop.

Select an option

Save mikedugan/8871197 to your computer and use it in GitHub Desktop.
bash script to find WordPress installations and version numbers
#! /bin/bash
for f in */
do
if [ -f $f/httpdocs/wp-includes/version.php ]; then
g=$(grep wp_version $f/httpdocs/wp-includes/version.php | tail -1)
echo $f - $g
elif [ -f $f/webshare/wp-includes/version.php ]; then
g=$(grep wp_version $f/webshare/wp-includes/version.php | tail -1)
echo $f - $g
elif [ -f $f/wp-includes/version.php ]; then
g=$(grep wp_version $f/wp-includes/version.php | tail -1)
echo $f - $g
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment