diff --git a/bundles/wordpress/README.md b/bundles/wordpress/README.md new file mode 100644 index 0000000..d623775 --- /dev/null +++ b/bundles/wordpress/README.md @@ -0,0 +1 @@ +https://developer.wordpress.org/advanced-administration/upgrade/upgrading/ diff --git a/bundles/wordpress/files/check_wordpress_insecure b/bundles/wordpress/files/check_wordpress_insecure new file mode 100644 index 0000000..e7294e8 --- /dev/null +++ b/bundles/wordpress/files/check_wordpress_insecure @@ -0,0 +1,25 @@ +#!/bin/bash + +SITE=$1 +VERSION=$(php -r "require('/opt/$SITE/wp-includes/version.php'); echo \$wp_version;") +STATUS=$(curl -ssL http://api.wordpress.org/core/stable-check/1.0/ | jq -r '.["'$VERSION'"]') + +echo "WordPress $VERSION is '$STATUS'" + +if [[ "$STATUS" == latest ]] +then + exit 0 +elif [[ "$STATUS" == outdated ]] +then + exit 1 +elif [[ "$STATUS" == insecure ]] +then + if test -f /etc/nginx/sites/$SITE + then + rm /etc/nginx/sites/$SITE + systemctl restart nginx + fi + exit 2 +else + exit 2 +fi diff --git a/bundles/wordpress/files/print-version.php b/bundles/wordpress/files/print-version.php new file mode 100644 index 0000000..3bf8de5 --- /dev/null +++ b/bundles/wordpress/files/print-version.php @@ -0,0 +1,5 @@ +