My bash script for nginx multisite on Ubuntu
-
Hope this helps someone. One little twist for me was that php8.5 had been recently installed on my system and thereby became the default version for my system command line, but I had php8.4 running WP and configured how I like. To change it back to 8.4 I had to remove the symbolic link to php that was in /etc/alternatives with
rm phpand then restore a proper one usingln -s /usr/bin/php8.4 phpI have almost 400 blogs and maybe half of them are disabled, so I opted to create an array of my good ones and loop over it:
#!/bin/bash
blogs=(
28
37
99
140
)
for i in "${blogs[@]}"
do
echo _______________________________________________________________________
echo "**** Blog $i ****"
wp index-mysql enable --all --blogid=$i --path="/usr/share/nginx/mysitedir" --allow-root
echo _______________________________________________________________________
echo ""
echo ""
doneIf you look up bash script instructions, you can modify this concept and create a numeric loop that attempts to update every blog sequentially. The script fails gracefully – I just didn’t want to wait for 30% failures.
You must be logged in to reply to this topic.