From 12be6361e2a2e8542a3c657653fe68121073b6e3 Mon Sep 17 00:00:00 2001 From: fgerlits Date: Thu, 29 Jun 2006 21:09:31 +0000 Subject: [PATCH] improving the devenv setup process, take 2 --- livesupport/bin/user_setup_db.sh | 16 ++++++++++++++-- livesupport/bin/user_setup_db_debian.sh | 16 ++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/livesupport/bin/user_setup_db.sh b/livesupport/bin/user_setup_db.sh index 786acf7a2..e1fb78c10 100755 --- a/livesupport/bin/user_setup_db.sh +++ b/livesupport/bin/user_setup_db.sh @@ -103,6 +103,17 @@ echo "for user: $user."; echo "" +#------------------------------------------------------------------------------- +# The details of installation +#------------------------------------------------------------------------------- +postgres_user=postgres + +ls_database=LiveSupport-$user +ls_dbuser=test +ls_dbpassword=test +ls_dbserver=localhost + + #------------------------------------------------------------------------------- # Function to check for the existence of an executable on the PATH # @@ -143,8 +154,6 @@ check_exe "odbcinst" || exit 1; #------------------------------------------------------------------------------- echo "Creating database and database user..."; -postgres_user=postgres - # FIXME: the below might not work for remote databases su - $postgres_user -c "echo \"CREATE USER $ls_dbuser \ @@ -171,6 +180,9 @@ odbcinst_template=$products_dir/scheduler/etc/odbcinst_template odbc_template=$products_dir/scheduler/etc/odbc_template odbc_template_tmp=/tmp/odbc_template.$$ +replace_sed_string="s/ls_database/$ls_database/; \ + s/ls_dbserver/$ls_dbserver/;" + # check for an existing PostgreSQL ODBC driver, and only install if necessary odbcinst_res=`odbcinst -q -d | grep "\[PostgreSQL\]"` if [ "x$odbcinst_res" == "x" ]; then diff --git a/livesupport/bin/user_setup_db_debian.sh b/livesupport/bin/user_setup_db_debian.sh index 67eadc690..91220e3df 100755 --- a/livesupport/bin/user_setup_db_debian.sh +++ b/livesupport/bin/user_setup_db_debian.sh @@ -103,6 +103,17 @@ echo "for user: $user."; echo "" +#------------------------------------------------------------------------------- +# The details of installation +#------------------------------------------------------------------------------- +postgres_user=postgres + +ls_database=LiveSupport-$user +ls_dbuser=test +ls_dbpassword=test +ls_dbserver=localhost + + #------------------------------------------------------------------------------- # Function to check for the existence of an executable on the PATH # @@ -143,8 +154,6 @@ check_exe "odbcinst" || exit 1; #------------------------------------------------------------------------------- echo "Creating database and database user..."; -postgres_user=postgres - # FIXME: the below might not work for remote databases su - $postgres_user -c "echo \"CREATE USER $ls_dbuser \ @@ -171,6 +180,9 @@ odbcinst_template=$products_dir/scheduler/etc/odbcinst_debian_template odbc_template=$products_dir/scheduler/etc/odbc_template odbc_template_tmp=/tmp/odbc_template.$$ +replace_sed_string="s/ls_database/$ls_database/; \ + s/ls_dbserver/$ls_dbserver/;" + # check for an existing PostgreSQL ODBC driver, and only install if necessary odbcinst_res=`odbcinst -q -d | grep "\[PostgreSQL\]"` if [ "x$odbcinst_res" == "x" ]; then