From c9719d91ca6e3ef57b31e5939d7e2c1169ffc75f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc?= Date: Sun, 4 Jul 2021 13:41:51 +0200 Subject: [PATCH] Conservation des volumes entre les installations --- podman-matrix/05_freshinstall.sh | 12 ++++-------- podman-matrix/90_prune.sh | 4 ++-- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/podman-matrix/05_freshinstall.sh b/podman-matrix/05_freshinstall.sh index f1dab81..b9885e2 100755 --- a/podman-matrix/05_freshinstall.sh +++ b/podman-matrix/05_freshinstall.sh @@ -9,17 +9,13 @@ ensure_not_root ensure_variables_are_defined "$envvars" -if [[ -d ~/.local/share/containers/storage/volumes/${confvolume} ]]; then - echo "Error : conf volume ${confvolume} already exists. Please remove it first (prune?)." - exit 1 +if [[ ! -d ~/.local/share/containers/storage/volumes/${confvolume} ]]; then + podman volume create matrixdotorg_synapse-data fi -if [[ -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then - echo "Error : db volume ${dbvolume} already exists. Please remove it first (prune?)." - exit 1 +if [[ ! -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then + podman volume create matrixdotorg_synapse-pgsql fi -podman volume create matrixdotorg_synapse-data && \ -podman volume create matrixdotorg_synapse-pgsql && \ podman run -it --name ${container_name}-generate --mount type=volume,src=matrixdotorg_synapse-data,dst=/data -e SYNAPSE_SERVER_NAME=garbaye.fr -e SYNAPSE_REPORT_STATS=no ${synapse_image}:${synapse_version} generate && \ podman rm ${container_name}-generate && \ podman unshare sed -i -e 's|^#public_baseurl: https://example.com/$|public_baseurl: ${GARBAYE_MATRIX_URL}|g' `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`/homeserver.yaml && \ diff --git a/podman-matrix/90_prune.sh b/podman-matrix/90_prune.sh index 6b2cf75..93231ad 100755 --- a/podman-matrix/90_prune.sh +++ b/podman-matrix/90_prune.sh @@ -18,8 +18,8 @@ ensure_systemd_unit_not_exists ${service_name} # remove volume #podman unshare rm -rf ~/${confvolume}/ -podman volume rm matrixdotorg_synapse-data -podman volume rm matrixdotorg_synapse-pgsql +#podman volume rm matrixdotorg_synapse-data +#podman volume rm matrixdotorg_synapse-pgsql # remove images #for image in ${upstream_images} ; do