From f8d51e49e7675916a33ed2098b83f8d172c551d7 Mon Sep 17 00:00:00 2001 From: Gitouche <26656-gitouche@users.noreply.framagit.org> Date: Fri, 28 Jan 2022 14:20:49 +0100 Subject: [PATCH] generalisation podman volume exists --- podman-framadate/05_freshinstall.sh | 2 +- podman-framadate/10_install.sh | 2 +- podman-matrix/05_freshinstall.sh | 2 +- podman-matrix/10_install.sh | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/podman-framadate/05_freshinstall.sh b/podman-framadate/05_freshinstall.sh index a2f6467..498a57d 100755 --- a/podman-framadate/05_freshinstall.sh +++ b/podman-framadate/05_freshinstall.sh @@ -9,7 +9,7 @@ ensure_not_root ensure_variables_are_defined "$envvars" -if [[ -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then +if podman volume exists ${dbvolume} ; then echo "Volume ${dbvolume} from previous installation already exists" echo "Please remove them before fresh install, or try to continue with normal installation" exit 1 diff --git a/podman-framadate/10_install.sh b/podman-framadate/10_install.sh index f3fa063..acf7a32 100755 --- a/podman-framadate/10_install.sh +++ b/podman-framadate/10_install.sh @@ -9,7 +9,7 @@ ensure_not_root ensure_variables_are_defined "$envvars" -if [[ ! -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then +if ! podman volume exists ${dbvolume} ; then echo "Error : conf volume ${dbvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install." exit 1 fi diff --git a/podman-matrix/05_freshinstall.sh b/podman-matrix/05_freshinstall.sh index b7d54da..c94e99b 100755 --- a/podman-matrix/05_freshinstall.sh +++ b/podman-matrix/05_freshinstall.sh @@ -9,7 +9,7 @@ ensure_not_root ensure_variables_are_defined "$envvars" -if [[ -d ~/.local/share/containers/storage/volumes/${confvolume} ]] || [[ -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then +if podman volume exists ${confvolume} || podman volume exists ${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 diff --git a/podman-matrix/10_install.sh b/podman-matrix/10_install.sh index d216ef7..b86761c 100755 --- a/podman-matrix/10_install.sh +++ b/podman-matrix/10_install.sh @@ -9,12 +9,12 @@ ensure_not_root ensure_variables_are_defined "$envvars" -if [[ ! -d ~/.local/share/containers/storage/volumes/${confvolume} ]]; then +if [[ ! podman volume exists ${confvolume} ]]; then echo "Error : conf volume ${confvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install." exit 1 fi -if [[ ! -d ~/.local/share/containers/storage/volumes/${dbvolume} ]]; then +if [[ ! podman volume exists ${dbvolume} ]]; then echo "Error : conf volume ${dbvolume} does not exists. Consider running 05_freshinstall.sh if this is the first install." exit 1 fi