Skip to content

Instantly share code, notes, and snippets.

@magenx magenx/multipatch-6788.sh
Last active Nov 23, 2015

Embed
What would you like to do?
#!/bin/bash
updatedb
PATCH1700="https://gist.githubusercontent.com/magenx/09372634b0a2e0238ffe/raw/60a43ba1d2b45ab709259f79c8ae5a6ec5cbd46b/PATCH_SUPEE-6788_CE_1.7.0.1_v1-2015-10-27-12-00-41.sh"
PATCH1701="https://gist.githubusercontent.com/magenx/09372634b0a2e0238ffe/raw/60a43ba1d2b45ab709259f79c8ae5a6ec5cbd46b/PATCH_SUPEE-6788_CE_1.7.0.1_v1-2015-10-27-12-00-41.sh"
PATCH1702="https://gist.githubusercontent.com/magenx/680470726049ef132e3f/raw/49b1be73e4511810805794afbc2874698d0e808d/PATCH_SUPEE-6788_CE_1.7.0.2_v1-2015-10-27-12-00-16.sh"
PATCH1800="https://gist.githubusercontent.com/magenx/61599be47f0af1d66c7b/raw/e59ef41a69a1787722cab2d9e3420eea80ecad3c/PATCH_SUPEE-6788_CE_1.8.0.0_v1-2015-10-26-11-59-56.sh"
PATCH1810="https://gist.githubusercontent.com/magenx/53ec7f88d189f80a8aae/raw/75e928480f67ef1b59d14ec2ea3804f0c3f8b07f/PATCH_SUPEE-6788_CE_1.8.1.0_v1-2015-10-26-11-59-27.sh"
PATCH1900="https://gist.githubusercontent.com/magenx/12367c15400027dc52e6/raw/fb3428ab0c292dcbdf34ce504f745128a5f9265d/PATCH_SUPEE-6788_CE_1.9.0.0_v1-2015-10-26-11-59-04.sh"
PATCH1901="https://gist.githubusercontent.com/magenx/c319b2f4351074bf9d47/raw/26fb16c02d21a014a346d4708a08c66eb1dccb5a/PATCH_SUPEE-6788_CE_1.9.0.1_v1-2015-10-26-11-46-45.sh"
PATCH1910="https://gist.githubusercontent.com/magenx/b86db8b807ef8e68a102/raw/a1608af3fc470fb3a65bbdac343f62b48abda3c3/PATCH_SUPEE-6788_CE_1.9.1.0_v1-2015-10-27-09-06-11.sh"
PATCH1911="https://gist.githubusercontent.com/magenx/c547a89648ebb9c98f1a/raw/43327dbf7dcaaa1c8621c89480ce8202ca9113b0/PATCH_SUPEE-6788_CE_1.9.1.1_v1-2015-10-26-11-45-55.sh"
PATCH1920="https://gist.githubusercontent.com/magenx/05ed023f8b8b395119ac/raw/d2cd68655a996924d5898fc334962f9fc8ff5a6b/PATCH_SUPEE-6788_CE_1.9.2.0_v1-2015-10-26-11-37-50.sh"
PATCH1921="https://gist.githubusercontent.com/magenx/42914fc06308a6a1a208/raw/45a5e3c503ed0a0e4ea59472bd4a2393fc6731fc/PATCH_SUPEE-6788_CE_1.9.2.1_v1-2015-10-26-11-38-41.sh"
DIRECTORY="dev/tests/functional"
for MAGENTOPATH in $(locate -r "app/etc/local.xml$")
do
cd ${MAGENTOPATH%/*/*/*}
MAGENTOVER=$(php -r "require 'app/Mage.php'; echo Mage::getVersion();")
PATCHAPPLY=PATCH${MAGENTOVER//./}
wget -q ${!PATCHAPPLY} --no-check-certificate
echo "VVV === Executing patch for Magento ${MAGENTOVER} === VVV"
mv .htaccess .htaccess_original
wget -qO .htaccess http://svn.magentocommerce.com/source/branches/1.7/.htaccess
wget -qO .htaccess.sample http://svn.magentocommerce.com/source/branches/1.7/.htaccess.sample
if [ "${MAGENTOVER//./}" -gt "1911" ] && [ ! -d "${DIRECTORY}" ]; then
mkdir -p dev/tests/functional/
wget -qO dev/tests/functional/.htaccess http://svn.magentocommerce.com/source/branches/1.7/.htaccess
fi
sh PATCH_SUPEE-6788_CE_${MAGENTOVER}_*.sh
mv .htaccess .htaccess_patched
mv .htaccess_original .htaccess
rm PATCH_SUPEE-6788_CE_${MAGENTOVER}_*.sh
wget -qO shell/fixSUPEE6788.php https://raw.githubusercontent.com/rhoerr/supee-6788-toolbox/master/fixSUPEE6788.php --no-check-certificate
echo
echo "====================================================================================================="
echo "Magento version: ${MAGENTOVER}"
echo "Magento path: ${MAGENTOPATH}"
awk '/SUPEE/' app/etc/applied.patches.list
echo "====================================================================================================="
echo
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.