This commit is contained in:
3wc 2020-11-05 16:08:06 +02:00
commit cb68d93e59
1 changed files with 15 additions and 0 deletions

15
wp-cloudron-update.sh Normal file
View File

@ -0,0 +1,15 @@
#!/usr/bin/env bash
mapfile -t CONTAINERS < <(docker container ls --format '{{ .ID }},{{ .Image }}' | grep wordpress)
DRY_RUN=" --dry-run"
if [ "$1" == "--live" ]; then
DRY_RUN=""
fi
for i in "${!CONTAINERS[@]}"; do
CONTAINERID="${CONTAINERS[$i]%,*}"
echo "Site $i, $CONTAINERID"
docker exec -u www-data -it "${CONTAINERID}" /app/pkg/wp plugin update --all $DRY_RUN
docker exec -u www-data -it "${CONTAINERID}" /app/pkg/wp theme update --all $DRY_RUN
done