From d8f302116d662f3a739c55bc698453cdbb0e282d Mon Sep 17 00:00:00 2001 From: maroy Date: Sun, 27 Mar 2005 12:11:14 +0000 Subject: [PATCH] added check for the sed executable added support for remote database hosts --- livesupport/bin/install.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/livesupport/bin/install.sh b/livesupport/bin/install.sh index a4a889d78..de6805f0b 100755 --- a/livesupport/bin/install.sh +++ b/livesupport/bin/install.sh @@ -22,7 +22,7 @@ # # # Author : $Author: maroy $ -# Version : $Revision: 1.5 $ +# Version : $Revision: 1.6 $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/bin/Attic/install.sh,v $ #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- @@ -296,6 +296,7 @@ fi #------------------------------------------------------------------------------- echo "Checking for required tools..." +check_exe "sed" || exit 1; check_exe "psql" || exit 1; check_exe "php" || exit 1; check_exe "pear" || exit 1; @@ -319,15 +320,17 @@ check_pear_module "XML_Util" || exit 1; #------------------------------------------------------------------------------- echo "Creating database and database user..."; +# FIXME: the below might not work for remote databases + su - $postgres_user -c "echo \"CREATE USER $ls_dbuser \ ENCRYPTED PASSWORD '$ls_dbpassword' \ CREATEDB NOCREATEUSER;\" \ - | psql template1" \ + | psql -h $ls_dbserver template1" \ || echo "Couldn't create database user $ls_dbuser."; su - $postgres_user -c "echo \"CREATE DATABASE \\\"$ls_database\\\" \ OWNER $ls_dbuser ENCODING 'utf-8';\" \ - | psql template1" \ + | psql -h $ls_dbserver template1" \ || echo "Couldn't create database $ls_database.";