mirror of
https://github.com/N0rthernL1ghts/wordpress.git
synced 2025-12-10 17:22:41 +01:00
Apply patch during build time
This commit is contained in:
@@ -16,17 +16,6 @@ function scriptExitHandler() {
|
||||
exit "${LAST_EXIT_CODE}"
|
||||
}
|
||||
|
||||
# Applies patch for making WordPress updates impossible
|
||||
function disableUpdatesPatch() {
|
||||
DISABLE_WP_UPDATES="${ENFORCE_DISABLE_WP_UPDATES:-true}"
|
||||
if [ "${DISABLE_WP_UPDATES}" != "false" ]; then
|
||||
echo "> Disabling WordPress updates..."
|
||||
patch /var/www/html/wp-admin/update-core.php </etc/wp-mods/wp-admin-update-core.patch
|
||||
echo "> Marking the patched file read-only..."
|
||||
chmod 0440 /var/www/html/wp-admin/update-core.php
|
||||
fi
|
||||
}
|
||||
|
||||
# Main function
|
||||
function main() {
|
||||
# Removes trailing zero if found
|
||||
@@ -53,13 +42,6 @@ function main() {
|
||||
return 0
|
||||
else
|
||||
echo "> Identified 'WordPress ${WP_VERSION}'"
|
||||
|
||||
# This will apply patch once and again only if container is recreated
|
||||
if [ ! -f "/var/www/patch-applied" ]; then
|
||||
disableUpdatesPatch
|
||||
touch "/var/www/patch-applied"
|
||||
fi
|
||||
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user