To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.

Statistics Download as Zip
| Branch: | Tag: | Revision:

root / deploy / provision.d / 080-database-load.sh @ 1597:eeacb8332051

History | View | Annotate | Download (477 Bytes)

1
#!/bin/bash
2

    
3
set -e
4

    
5
# Start the database and if a dump file is found, load it. The dump
6
# file is then deleted so that the db won't be overwritten on
7
# subsequent runs. (The original repo contains no dump file, so it
8
# should exist only if you have provided some data to load.)
9

    
10
/etc/init.d/postgresql start
11

    
12
cd /var/www/code
13

    
14
if [ -f postgres-dumpall ]; then
15
    chmod ugo+r postgres-dumpall
16
    sudo -u postgres psql -f postgres-dumpall postgres
17
    rm postgres-dumpall
18
fi
19