Axel Braun 2018-06-17 15:30:45 +00:00 committed by Git OBS Bridge
parent eb7c788def
commit c28611211b

View File

@ -24,12 +24,18 @@
#
##############################################################################
#-----------------------------------------------------------------------------
# Change log
#-----------------------------------------------------------------------------
# V 0.2 20180617 Axel Replace tryton with ${DB_USER}
#-----------------------------------------------------------------------------
# Variables declaration
#-----------------------------------------------------------------------------
#GNU Health installer for openSUSE version
VERSION="0.1"
VERSION="0.2"
# Colors constants
NONE="$(tput sgr0)"
@ -124,13 +130,13 @@ echo "Postgres trust method changed"
echo "Create database user"
#create user
sudo -u postgres psql -c "CREATE USER tryton WITH CREATEDB;" || bailout
sudo -u postgres psql -c "CREATE USER ${DB_USER} WITH CREATEDB;"
echo "Database user created"
echo "Creating database ${DB_NAME}"
# create database
sudo -u postgres createdb ${DB_NAME} --encoding='UTF8' --owner=tryton || bailout
sudo -u postgres createdb ${DB_NAME} --encoding='UTF8' --owner=${DB_USER} || bailout
echo "Database created"
#exit as postgres