Parcourir la source

fix: Add a check for existing docker db volume

Fixes https://github.com/knadh/listmonk/issues/517
Karan Sharma il y a 3 ans
Parent
commit
6cd7d669c1
1 fichiers modifiés avec 9 ajouts et 0 suppressions
  1. 9 0
      install-prod.sh

+ 9 - 0
install-prod.sh

@@ -44,6 +44,14 @@ check_dependencies() {
 	fi
 	fi
 }
 }
 
 
+check_existing_db_volume() {
+	info "checking for an existing docker db volume"
+	if docker volume inspect listmonk_listmonk-data >/dev/null 2>&1; then
+		error "listmonk-data volume already exists. Please use docker-compose down -v to remove old volumes for a fresh setup of PostgreSQL."
+		exit 1
+	fi
+}
+
 download() {
 download() {
 	curl --fail --silent --location --output "$2" "$1"
 	curl --fail --silent --location --output "$2" "$1"
 }
 }
@@ -124,6 +132,7 @@ show_output(){
 
 
 
 
 check_dependencies
 check_dependencies
+check_existing_db_volume
 get_config
 get_config
 get_containers
 get_containers
 modify_config
 modify_config