#!/bin/sh
# restore the old databases
dump=/var/tmp/db.out.gz
if [ -e $dump -a -x /usr/bin/psql ]; then
  if [ ! `ps x 2>&1 | grep postmaster` ]; then
    /usr/bin/pg_ctl -l /var/log/postgresql.log start
  fi
  (gunzip -c $dump | /usr/bin/psql) && rm $dump
fi
