Skip to content

Commit

Permalink
update inc/wpsetup.inc auto updater script
Browse files Browse the repository at this point in the history
script setup on centmin.sh menu option 22 wordpress auto install creates an cronjob script at /root/tools/wp_updater_${vhostname}.sh where vhostname = your site domain name. This script auto updates wordpress via wp-cli cmd tool

however it's own wp-cli cli update command doesn't work as root user

this doesn't work as root user

/usr/bin/wp cli update --allow-root

so changing and replacing that line in /root/tools/wp_updater_${vhostname}.sh with following manual update lines

echo "update wp-cli"
rm -rf /usr/bin/wp
wget -cnv --no-check-certificate https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /usr/bin/wp --tries=3
chmod 0700 /usr/bin/wp
  • Loading branch information
centminmod committed Sep 15, 2015
1 parent c0dc535 commit 5539013
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion inc/wpsetup.inc
Expand Up @@ -771,7 +771,12 @@ EMAIL=$WPADMINEMAIL
{ {
cd /home/nginx/domains/${vhostname}/public cd /home/nginx/domains/${vhostname}/public
echo "/home/nginx/domains/${vhostname}/public" echo "/home/nginx/domains/${vhostname}/public"
/usr/bin/wp cli update --allow-root #/usr/bin/wp cli update --allow-root
echo "update wp-cli"
rm -rf /usr/bin/wp
wget -cnv --no-check-certificate https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar -O /usr/bin/wp --tries=3
chmod 0700 /usr/bin/wp
/usr/bin/wp --info --allow-root
/usr/bin/wp plugin status --allow-root /usr/bin/wp plugin status --allow-root
/usr/bin/wp plugin update --all --allow-root /usr/bin/wp plugin update --all --allow-root
} 2>&1 | mail -s "Wordpress WP-CLI Auto Update \$(date)" \$EMAIL } 2>&1 | mail -s "Wordpress WP-CLI Auto Update \$(date)" \$EMAIL
Expand Down

0 comments on commit 5539013

Please sign in to comment.