diff options
author | Adis Nezirovic <adis_at_linux.org.ba> | 2013-10-26 00:40:32 -0500 |
---|---|---|
committer | Robby Workman <rworkman@slackbuilds.org> | 2013-10-27 23:38:51 -0500 |
commit | b81b97324fb0fd50f5a9e29c974c25744a7f1e2d (patch) | |
tree | a29383f2e861b9a67efcb670c8c72fd9832425fd /system/postgresql/setup.postgresql | |
parent | 319f898b5f28a560edd68c09dcc7c8facecf0280 (diff) | |
download | slackbuilds-b81b97324fb0fd50f5a9e29c974c25744a7f1e2d.tar.gz |
system/postgresql: Updated for version 9.3.0.
Signed-off-by: Robby Workman <rworkman@slackbuilds.org>
Diffstat (limited to 'system/postgresql/setup.postgresql')
-rw-r--r-- | system/postgresql/setup.postgresql | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/system/postgresql/setup.postgresql b/system/postgresql/setup.postgresql index ba0674c93c..d677a5cc6a 100644 --- a/system/postgresql/setup.postgresql +++ b/system/postgresql/setup.postgresql @@ -6,25 +6,27 @@ PG_USER=postgres PG_USER_ID=@UID@ PG_GROUP=postgres PG_GROUP_ID=@GID@ +PG_VERSION=@PG_VERSION@ echo "Adding PostgreSQL user and group..." groupadd -g $PG_GROUP_ID $PG_GROUP useradd -g $PG_GROUP -u $PG_USER_ID -d $PG_HOME -c PostgreSQL $PG_USER -mkdir -p $PG_HOME/data +mkdir -p $PG_HOME/$PG_VERSION/data ## default permissions echo "Setting up permissions..." chown -R $PG_USER:$PG_GROUP $PG_HOME chmod 700 $PG_HOME -chmod 700 $PG_HOME/data +chmod 700 $PG_HOME/$PG_VERSION +chmod 700 $PG_HOME/$PG_VERSION/data ## database cluster -if [ ! -f $PG_HOME/data/PG_VERSION ]; then - echo "Creating database cluster in $PG_HOME/data..." - su $PG_USER -c "initdb -D $PG_HOME/data" +if [ ! -f $PG_HOME/$PG_VERSION/data/PG_VERSION ]; then + echo "Creating database cluster in $PG_HOME/$PG_VERSION/data..." + su $PG_USER -c "initdb -D $PG_HOME/$PG_VERSION/data" else echo "*** WARNING ***" >&2 - echo " There is already a database cluster in $PG_HOME/data." >&2 + echo " There is already a database cluster in $PG_HOME/$PG_VERSION/data." >&2 echo " If you are upgrading from an older version of PostgreSQL" >&2 echo " you will have to 'dump' and 'restore' your database." >&2 echo " See PostgreSQL manual for more details." >&2 |