Merge pull request #518 from mr-karan/script_fix

fix: Add a check for existing docker db volume
This commit is contained in:
Kailash Nadh 2021-10-18 10:18:30 +05:30 committed by GitHub
commit f91b27dc8f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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"
}
@ -124,6 +132,7 @@ show_output(){
check_dependencies
check_existing_db_volume
get_config
get_containers
modify_config