Last active
August 31, 2022 05:35
-
-
Save bahadoribnm/2a57cc5a7e0be2e169dc31f2c2b8daed to your computer and use it in GitHub Desktop.
Bash script to find Joomla and Wordpress versions in cPanel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
find /home/*/public_html/libraries/cms/* -type f -name 'version.php' |\ | |
while read filepath; | |
do | |
#version=$(cat $filepath |grep -Po "const RELEASE = '\K[^']*"); | |
#[ ! -z version ] && echo $(echo $filepath |cut -d "/" -f 3) $version >> joomla.version | |
echo $(echo $filepath |cut -d "/" -f 3) $(cat $filepath |grep -Po "const RELEASE = '\K[^']*") >> joomla.version | |
done; | |
find /home/*/public_html/wp-includes -type f -name 'version.php'|\ | |
while read fname; | |
do | |
echo -e "$(echo $fname|cut -d "/" -f 3) \t\t|$(grep '$wp_version' $fname)" >> wordpress.version | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment