ne pas exécuter l'installation si au moins un volume existe
This commit is contained in:
parent
0513cefac8
commit
dabd1d3c22
|
@ -9,19 +9,18 @@ ensure_not_root
|
|||
|
||||
ensure_variables_are_defined "$envvars"
|
||||
|
||||
if [[ ! -d ~/.local/share/containers/storage/volumes/${confvolume} ]]; then
|
||||
podman volume create matrixdotorg_synapse-data
|
||||
if [[ -d ~/.local/share/containers/storage/volumes/${confvolume} || -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then
|
||||
echo "Files or volumes from previous installation already exists"
|
||||
echo "Please remove them before fresh install, or try continue with normal installation"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ ! -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then
|
||||
podman volume create matrixdotorg_synapse-pgsql
|
||||
fi
|
||||
if [[ ! -f `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`/homeserver.yaml ]]; then
|
||||
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
|
||||
fi
|
||||
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 && \
|
||||
podman unshare sed -z -i -e "s|database:\n name: sqlite3\n args:\n database: /data/homeserver.db|database:\n name: psycopg2\n args:\n user: synapse\n password: ${GARBAYE_MATRIX_POSTGRES_PASSWORD}\n database: synapse\n host: synapse-db\n port: 5432\n cp_min: 5\n cp_max: 10|g" `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`/homeserver.yaml && \
|
||||
podman unshare sed -i -e "s|^#enable_registration: false$|enable_registration: false|g" `podman volume inspect --format '{{ .Mountpoint }}' matrixdotorg_synapse-data`/homeserver.yaml && \
|
||||
podman volume create ${confvolume} \
|
||||
podman volume create ${dbvolume} \
|
||||
podman run -it --name ${container_name}-generate --mount type=volume,src=${confvolume},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 }}' ${confvolume}`/homeserver.yaml && \
|
||||
podman unshare sed -z -i -e "s|database:\n name: sqlite3\n args:\n database: /data/homeserver.db|database:\n name: psycopg2\n args:\n user: synapse\n password: ${GARBAYE_MATRIX_POSTGRES_PASSWORD}\n database: synapse\n host: synapse-db\n port: 5432\n cp_min: 5\n cp_max: 10|g" `podman volume inspect --format '{{ .Mountpoint }}' ${confvolume}`/homeserver.yaml && \
|
||||
podman unshare sed -i -e "s|^#enable_registration: false$|enable_registration: false|g" `podman volume inspect --format '{{ .Mountpoint }}' ${confvolume}`/homeserver.yaml && \
|
||||
${ABSDIR}/10_install.sh
|
||||
|
||||
|
|
Loading…
Reference in a new issue