Hallo, heute geht es um das automatisierte Update von WordPress.
Gerade wenn mehrere Seiten betrieben werden artet dies in Arbeit aus. Tools wie Infinite WP sind hier eine Option aber kostefrei nur beschränkt nutzbar.
#!/bin/bash
blacklist="test.santor.de test.santor.de"
rmfiles="wp-config-sample.php license.txt liesmich.html readme.html"
chmod -R g+w /var/www/*/httpdocs/*
cd /var/www
for domain in $(find . -name wp-config.php|awk -F'/' '{print $2}'|sort -u)
do
count=$(echo $blacklist|grep $domain |wc -l)
if [ $count -eq 0 ]; then
echo "############################"
echo "# $domain"
echo "############################"
cd /var/www/$domain/httpdocs
wp core update --allow-root
wp plugin update --all --allow-root
wp theme update --all --allow-root
wp language core update --allow-root
wp language plugin --all update --allow-root
wp language theme --all update --allow-root
for rmfile in $rmfiles; do
if [ -f $rmfile ]; then
rm $rmfile
fi
done
fi
done
/root/scripts/wp-security.sh