#!/bin/bash wp_version=$(sudo -u apache wp-cli core version) wp_update_version=$(sudo -u apache wp-cli core check-update --field=version) if ! ( echo "$wp_update_version" | grep -i "success" > /dev/null ) && [ "$wp_version" != "$wp_update_version" ]; then echo "Wordpress update is available: $wp_version → $wp_update_version" fi