From cb68d93e59b5cf71e020a1c0bf923209ceac09f6 Mon Sep 17 00:00:00 2001 From: 3wc <3wc.git@doesthisthing.work> Date: Thu, 5 Nov 2020 16:08:06 +0200 Subject: [PATCH] Initial --- wp-cloudron-update.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 wp-cloudron-update.sh 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