Last active
June 1, 2018 22:32
-
-
Save M0LTE/5ce7dc57bf5d10b1fe80bf3c05650d69 to your computer and use it in GitHub Desktop.
Wordpress updates
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#in /root/update-wordpress.sh: | |
#!/bin/bash -e | |
export PATH="$PATH:/usr/local/bin" | |
# change this | |
siteroot=/var/www/html | |
webserveruser=nginx | |
wp cli update --quiet | |
wp core update --path=$siteroot --allow-root --quiet | |
wp core language update --path=$siteroot --allow-root --quiet | |
wp plugin update --all --path=$siteroot --allow-root --quiet | |
wp theme update --all --path=$siteroot --allow-root --quiet | |
chown root:root -R $siteroot | |
chmod a+rx -R $siteroot | |
chown $webserveruser:$webserveruser -R $siteroot/wp-content | |
#chown $webserveruser:$webserveruser $siteroot/wp-content/plugins/wordfence | |
#chmod a+rxw $siteroot/wp-content/wflogs/attack-data.php | |
#chmod a+rxw $siteroot/wp-content/wflogs/ips.php | |
#chmod a+rxw $siteroot/wp-content/wflogs/config.php | |
#chmod a+rxw $siteroot/wp-content/wflogs/rules.php | |
#Installing the wp command is fairly straightforward- in the default case: | |
sudo yum install php-cli | |
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | |
chmod +x wp-cli.phar | |
sudo mv wp-cli.phar /usr/local/bin/wp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment