Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/bin/bash
updatedb
PATCH1620="https://gist.githubusercontent.com/magenx/ee00c33a95a5c1d43100/raw/f4932a762d7bc344caf02d2446c87aa9cd797348/PATCH_SUPEE-7405_CE_1.6.2.0_v1-2016-01-20-06-27-39.sh"
PATCH1700="https://gist.githubusercontent.com/magenx/ebd84626fab92f1096e4/raw/a23ff3c029178e4ccd1f460670a224311c334948/PATCH_SUPEE-7405_CE_1.7.0.2_v1-2016-01-20-04-58-44.sh"
PATCH1701="https://gist.githubusercontent.com/magenx/ebd84626fab92f1096e4/raw/a23ff3c029178e4ccd1f460670a224311c334948/PATCH_SUPEE-7405_CE_1.7.0.2_v1-2016-01-20-04-58-44.sh"
PATCH1702="https://gist.githubusercontent.com/magenx/ebd84626fab92f1096e4/raw/a23ff3c029178e4ccd1f460670a224311c334948/PATCH_SUPEE-7405_CE_1.7.0.2_v1-2016-01-20-04-58-44.sh"
PATCH1800="https://gist.githubusercontent.com/magenx/72e4355b8eb7cd7abe54/raw/d2fbcd1c66e918e9d91603b6c0eaa59519d3f3b7/PATCH_SUPEE-7405_CE_1.8.0.0_v1-2016-01-20-04-48-23.sh"
PATCH1810="https://gist.githubusercontent.com/magenx/60c145ebe678391e6a35/raw/90dbc95ffaea56e96383729fa12d4d831ee2a25e/PATCH_SUPEE-7405_CE_1.8.1.0_v1-2016-01-20-04-47-00.sh"
PATCH1900="https://gist.githubusercontent.com/magenx/5265e9cc298c850bd1e3/raw/1c105c0b538dfe8fe3ef4711cd9df51ee2b93388/PATCH_SUPEE-7405_CE_1.9.0.1_v1-2016-01-20-04-45-14.sh"
PATCH1901="https://gist.githubusercontent.com/magenx/5265e9cc298c850bd1e3/raw/1c105c0b538dfe8fe3ef4711cd9df51ee2b93388/PATCH_SUPEE-7405_CE_1.9.0.1_v1-2016-01-20-04-45-14.sh"
PATCH1910="https://gist.githubusercontent.com/magenx/124e94c322f2abc4ecee/raw/36f7d9a59cab041faea6a3265e9868b9f8d7fce0/PATCH_SUPEE-7405_CE_1.9.1.1_v1-2016-01-20-04-42-03.sh"
PATCH1911="https://gist.githubusercontent.com/magenx/124e94c322f2abc4ecee/raw/36f7d9a59cab041faea6a3265e9868b9f8d7fce0/PATCH_SUPEE-7405_CE_1.9.1.1_v1-2016-01-20-04-42-03.sh"
PATCH1920="https://gist.githubusercontent.com/magenx/22694bd964f7eeaee30b/raw/bd23394b7bee859e63cd7fecbe66dfec90b38dcc/PATCH_SUPEE-7405_CE_1.9.2.2_v1-2016-01-20-04-35-33.sh"
PATCH1921="https://gist.githubusercontent.com/magenx/22694bd964f7eeaee30b/raw/bd23394b7bee859e63cd7fecbe66dfec90b38dcc/PATCH_SUPEE-7405_CE_1.9.2.2_v1-2016-01-20-04-35-33.sh"
PATCH1922="https://gist.githubusercontent.com/magenx/22694bd964f7eeaee30b/raw/bd23394b7bee859e63cd7fecbe66dfec90b38dcc/PATCH_SUPEE-7405_CE_1.9.2.2_v1-2016-01-20-04-35-33.sh"
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"
sh PATCH_SUPEE-7405_CE_*.sh
rm PATCH_SUPEE-7405_CE_*.sh
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