Source

htsql / cogs.local / data / vm / pgsql91-update.sh

#/bin/sh

# Post-installation script for the pgsql91 VM.
set -ex

# Update the hostname.
echo pgsql91-vm >/etc/hostname

# Install the PostgreSQL 9.1 server from backports.
apt-get -qy -t squeeze-backports install postgresql-9.1

# Clean APT cache.
apt-get clean

# Set the password of the user postgres to 'admin'.
su -c "psql -c \"ALTER ROLE postgres WITH PASSWORD 'admin'\"" postgres

# Configure PostgreSQL to listen on all interfaces.
cat <<END >>/etc/postgresql/9.1/main/postgresql.conf

# Listen on all available interfaces:
listen_addresses = '*'
END

# Configure PostgreSQL to allow login from the external interface.
cat <<END >>/etc/postgresql/9.1/main/pg_hba.conf

# Allow external network connections:
host all all 10.0.0.1/8 md5
END
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.