The following script is tested on Single WordPress Only.
$ wget https://gist.githubusercontent.com/MiteshShah/cd4d86cbdfa60a069aa9/raw/831d8d41f0411b97682649a57c119e137619a986/wp_update.sh
$ sudo bash wp_update.sh
Enter Web Root Path [/var/www]:
Enter Web Root Path [htdocs]:
Enter Web Root Path [www-data]:
Enter Web Root Path [www-data]:
WEB_ROOT = /var/www
WEB_ROOT_PREFIX = htdocs
WEB_ROOT_OWNER = www-data
WEB_ROOT_GROUP = www-data
PHP binary: /usr/bin/php5
PHP version: 5.6.10-1+deb.sury.org~trusty+1
php.ini used: /etc/php5/cli/php.ini
WP-CLI root dir: phar://wp-cli.phar
WP-CLI global config:
WP-CLI project config:
WP-CLI version: 0.19.2
Found wp-admin at /var/www/example.com/htdocs/wp-admin
Updating to version 4.2.2 (en_US)...
Downloading update from https://downloads.wordpress.org/release/wordpress-4.2.2-new-bundled.zip...
Unpacking the update...
Success: WordPress updated successfully.
Downloading update from https://downloads.wordpress.org/plugin/akismet.3.1.2.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Success: Translations updates are not needed for the 'English (US)' locale.
Success: Updated 1/1 plugins.
name old_version new_version status
akismet 3.0.2 3.1.2 Updated
Enabling Maintenance mode...
Downloading update from https://downloads.wordpress.org/theme/twentyfourteen.1.4.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
Downloading update from https://downloads.wordpress.org/theme/twentythirteen.1.5.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
Downloading update from https://downloads.wordpress.org/theme/twentytwelve.1.7.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
Disabling Maintenance mode...
Success: Translations updates are not needed for the 'English (US)' locale.
Success: Updated 3/3 themes.