- pear module check seems to say true on pkgs not installed.
 - psql want to have existing database name as 1st arg if postgres database
doesn't exists - template1 added ...
This commit is contained in:
tomas 2005-03-25 18:37:24 +00:00
parent d6c3e9ba73
commit 6398a28317

View file

@ -21,8 +21,8 @@
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
# #
# #
# Author : $Author: maroy $ # Author : $Author: tomas $
# Version : $Revision: 1.2 $ # Version : $Revision: 1.3 $
# Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/bin/Attic/install.sh,v $ # Location : $Source: /home/paul/cvs2svn-livesupport/newcvsrepo/livesupport/bin/Attic/install.sh,v $
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
@ -220,7 +220,8 @@ check_exe() {
# @return 0 if the module is available, non-0 otherwise # @return 0 if the module is available, non-0 otherwise
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
check_pear_module() { check_pear_module() {
if [ "`pear info $1`" ]; then test_result=`pear info $1`
if [ $? = 0 ]; then
echo "PEAR module $1 found..."; echo "PEAR module $1 found...";
return 0; return 0;
else else
@ -269,12 +270,12 @@ echo "Creating database and database user...";
su - $postgres_user -c "echo \"CREATE USER $ls_dbuser \ su - $postgres_user -c "echo \"CREATE USER $ls_dbuser \
ENCRYPTED PASSWORD '$ls_dbpassword' \ ENCRYPTED PASSWORD '$ls_dbpassword' \
CREATEDB NOCREATEUSER;\" \ CREATEDB NOCREATEUSER;\" \
| psql" \ | psql template1" \
|| echo "Couldn't create database user $ls_dbuser."; || echo "Couldn't create database user $ls_dbuser.";
su - $postgres_user -c "echo \"CREATE DATABASE \\\"$ls_database\\\" \ su - $postgres_user -c "echo \"CREATE DATABASE \\\"$ls_database\\\" \
OWNER $ls_dbuser ENCODING 'utf-8';\" \ OWNER $ls_dbuser ENCODING 'utf-8';\" \
| psql" \ | psql template1" \
|| echo "Couldn't create database $ls_database."; || echo "Couldn't create database $ls_database.";