commit cb68d93e59b5cf71e020a1c0bf923209ceac09f6 Author: 3wc <3wc.git@doesthisthing.work> Date: Thu Nov 5 16:08:06 2020 +0200 Initial diff --git a/wp-cloudron-update.sh b/wp-cloudron-update.sh new file mode 100644 index 0000000..be850e1 --- /dev/null +++ b/wp-cloudron-update.sh @@ -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