From 38837d9c43e830ff0478a6f29f16c980a933129c Mon Sep 17 00:00:00 2001 From: fly Date: Tue, 14 Dec 2021 14:57:13 +0000 Subject: [PATCH] Use hostname from general settings in create-db Signed-off-by: merspieler --- create-db | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/create-db b/create-db index be81821..14748a2 100755 --- a/create-db +++ b/create-db @@ -17,7 +17,7 @@ root_path="$( cd "$(dirname "$0")" ; pwd -P )" auth=pw -hostname=localhost +db_host=localhost first=1 while [[ $# -gt 0 ]] @@ -32,7 +32,7 @@ case $key in ;; -H|--host) - hostname="$2" + db_host="$2" shift # past argument shift # past value ;; @@ -98,11 +98,11 @@ if [ "$auth" = "sudo" ]; then psql -d "$database" -f "$root_path"/sql/pgsnapshot_schema_0.6.sql psql -d "$database" -f "$root_path"/sql/pgsnapshot_schema_0.6_bbox.sql else - createdb --host="$hostname" --username=postgres --encoding=UTF8 --owner=$db_user "$database" - psql --host="$hostname" --username=postgres --dbname="$database" -c "CREATE EXTENSION postgis;" - psql --host="$hostname" --username=postgres --dbname="$database" -c "CREATE EXTENSION hstore;" - psql --host="$hostname" --username=postgres -d "$database" -f "$root_path"/sql/pgsnapshot_schema_0.6.sql - psql --host="$hostname" --username=postgres -d "$database" -f "$root_path"/sql/pgsnapshot_schema_0.6_bbox.sql + createdb --host="$db_host" --username=postgres --encoding=UTF8 --owner=$db_user "$database" + psql --host="$db_host" --username=postgres --dbname="$database" -c "CREATE EXTENSION postgis;" + psql --host="$db_host" --username=postgres --dbname="$database" -c "CREATE EXTENSION hstore;" + psql --host="$db_host" --username=postgres -d "$database" -f "$root_path"/sql/pgsnapshot_schema_0.6.sql + psql --host="$db_host" --username=postgres -d "$database" -f "$root_path"/sql/pgsnapshot_schema_0.6_bbox.sql fi