blob: 4f81e0da625893b10600c80486a02792824fbd8a [file] [log] [blame]
Yulia Portnova058a2882015-02-20 17:59:12 +02001#!/bin/bash
2
3# install postgres
4apt-get update
5apt-get install postgresql postgresql-contrib
6
7# check if postrges cluster created
8
9if [ ! -d /etc/postgresql ]; then
10 err=$(pg_createcluster 9.3 main --start 2>&1 /dev/null )
11 if [ $? -ne 0 ]; then
12 echo "There was an error while creating cluster"
13 exit 1
14 fi
15fi
16
17sed -i 's/^local\s\+all\s\+all\s\+peer/local all all trust/g' /etc/postgresql/9.3/main/pg_hba.conf
18echo "listen_address = '*'" >> /etc/postgresql/9.3/main/postgresql.conf
19
20