Last active
February 22, 2018 00:48
-
-
Save renekreijveld/13e1b83212f62f66bcd888548f010702 to your computer and use it in GitHub Desktop.
Bash script to find all Joomla extension updates in all Joomla instances on a DirectAdmin based server
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/sh | |
# listupdates -- Find Joomla instances and show all extension updates | |
# | |
# Copyright 2016 Rene Kreijveld - [email protected] | |
# | |
# This program is free software; you may redistribute it and/or modify it. | |
# | |
# Version history | |
# 1.0 Initial version | |
# This script uses two other scripts to function properly. | |
# 1. The jfunctions script to get information about the found Joomla instances. | |
# Get jfunctions here: https://gist.github.com/renekreijveld/773ce744080f6dbb58d8a4b91b984414 | |
# 2. The listupdates.php script to get all extension updates for a Joomla instance. | |
# Get listupdates.php here: https://gist.github.com/renekreijveld/978523c79183b615917c03130505aad1 | |
# define variables | |
version=1.0 | |
startdir=/home | |
# Determine path of script | |
mypath=$(cd $(dirname ${0}); pwd -P) | |
# display usage information | |
usage() { | |
echo "" | |
echo "${myname} version ${version}, written by Rene Kreijveld." | |
echo "" | |
exit 0 | |
} | |
for dir in $(find ${startdir} -maxdepth 4 -type d -name "public_html"); do | |
if [ -f ${dir}/configuration.php ]; then | |
# possible joomla found | |
cd ${dir} | |
# gather joomla information | |
if [ ! -e ${mypath}/jfunctions ] | |
then | |
echo "" | |
echo "Script jfunctions not found. Get it here: https://gist.github.com/renekreijveld/773ce744080f6dbb58d8a4b91b984414" | |
echo "" | |
else | |
. ${mypath}/jfunctions | |
echo "Sitename:" $sitenameclean | |
echo "Version:" $versr.$versd $verss | |
# Show updates | |
cd cli | |
if [ ! -e ./listupdates.php ] | |
then | |
echo "" | |
echo "File listupdates.php not found. Get it here: https://gist.github.com/renekreijveld/978523c79183b615917c03130505aad1" | |
echo "" | |
else | |
/usr/local/bin/php listupdates.php | |
fi | |
fi | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment