Skip to content

Commit

Permalink
Merge pull request #518 from mr-karan/script_fix
Browse files Browse the repository at this point in the history
fix: Add a check for existing docker db volume
  • Loading branch information
knadh authored Oct 18, 2021
2 parents 3064844 + 6cd7d66 commit f91b27d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions install-prod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ check_dependencies() {
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() {
curl --fail --silent --location --output "$2" "$1"
}
Expand Down Expand Up @@ -124,6 +132,7 @@ show_output(){


check_dependencies
check_existing_db_volume
get_config
get_containers
modify_config
Expand Down

0 comments on commit f91b27d

Please sign in to comment.