mirror of
https://github.com/lildude/ha-addon-teslamate.git
synced 2026-10-13 13:10:30 -04:00
@@ -61,7 +61,7 @@ fi
|
||||
if pg_isready -h "$DATABASE_HOST" -p "$DATABASE_PORT" > /dev/null 2>&1; then
|
||||
bashio::log.info "Creating database '$DATABASE_NAME' on $DATABASE_HOST"
|
||||
|
||||
if [[ -n $(PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -Atqc "\list $DATABASE_NAME") ]]; then
|
||||
if [[ -n $(PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -Atqc "\list \"$DATABASE_NAME\"") ]]; then
|
||||
bashio::log.info "Database $DATABASE_NAME already exists"
|
||||
else
|
||||
if PGPASSWORD="$DATABASE_PASS" psql -h "$DATABASE_HOST" -p "$DATABASE_PORT" -U "$DATABASE_USER" postgres -qc "CREATE DATABASE \"$DATABASE_NAME\""; then
|
||||
|
||||
Reference in New Issue
Block a user