2021-03-19 19:10:54 +01:00
|
|
|
#!/usr/bin/env sh
|
|
|
|
set -e
|
|
|
|
|
2021-09-23 17:44:41 +02:00
|
|
|
WP_VERSION="${1:-}"
|
|
|
|
|
|
|
|
if [ -z "${WP_VERSION}" ]; then
|
|
|
|
echo "> Error: WP_VERSION is not specified"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2021-03-19 19:10:54 +01:00
|
|
|
echo "> Building helper image..."
|
2021-09-23 17:44:41 +02:00
|
|
|
docker build --build-arg "WP_VERSION=${WP_VERSION}" -t local/wp-patch-util .
|
2021-03-19 19:10:54 +01:00
|
|
|
mkdir wp-src/ -p
|
|
|
|
echo ""
|
|
|
|
echo "> Running helper container..."
|
|
|
|
|
|
|
|
USER_ID=$(id -u "${USER}")
|
|
|
|
GROUP_ID=$(id -g "${USER}")
|
|
|
|
|
|
|
|
docker run --rm -t --name="wp-patch-util-$(date +%s)" -v "${PWD}/wp-src:/wp/src" -e "UID=${USER_ID}" -e "GID=${GROUP_ID}" local/wp-patch-util
|
|
|
|
sudo chown "${USER}:${USER}" wp-src -R
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "> Two files are now downloaded to wp-src"
|
|
|
|
echo "> Please update wp-src/mod-update-core.php with code bellow and then execute ./01-create-patch.sh"
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
echo "wp_die("
|
2021-03-19 19:29:17 +01:00
|
|
|
echo " __( 'Sorry, you are not allowed to update this site.' ) ."
|
2023-04-02 20:25:19 +02:00
|
|
|
echo " ' Click <a href=\"https://github.com/N0rthernL1ghts/wordpress/wiki/WordPress-Core-Updates\" target=\"_blank\">here</a> to learn why.'"
|
2021-03-19 19:10:54 +01:00
|
|
|
echo ");"
|
2021-09-23 17:44:41 +02:00
|
|
|
echo ""
|