[Lada-commits] [PATCH] Allow setting variables via commandline

Wald Commits scm-commit at wald.intevation.org
Tue Feb 2 15:06:12 CET 2016


# HG changeset patch
# User Tom Gottfried <tom at intevation.de>
# Date 1454421809 -3600
# Node ID e797391714a09d6c79e35709cc8219c8b009571e
# Parent  2ce24e2baf204dfb9170bc68ce9b03edf9c05b1a
Allow setting variables via commandline.

diff -r 2ce24e2baf20 -r e797391714a0 db_schema/setup-db.sh
--- a/db_schema/setup-db.sh	Thu Jan 28 12:16:23 2016 +0100
+++ b/db_schema/setup-db.sh	Tue Feb 02 15:03:29 2016 +0100
@@ -1,9 +1,9 @@
 #!/bin/sh
 DIR=`dirname $0`
 
-ROLE_NAME=lada
-ROLE_PW=lada
-DB_NAME=lada
+ROLE_NAME=${1:-lada}
+ROLE_PW=${2:-$ROLE_NAME}
+DB_NAME=${3:-$ROLE_NAME}
 
 psql --command "CREATE USER $ROLE_NAME PASSWORD '$ROLE_PW';"
 createdb -E UTF-8 $DB_NAME


More information about the Lada-commits mailing list