#!/bin/sh

status=$(/sbin/e-smith/config getprop postgresql status)
if [ "$status" = "disabled" ]
then
    echo "postgresql is disabled - no tables dumped" >&2
    exit 0
fi
umask 027
exec >/home/e-smith/db/pgsql/pgsql.dump
chgrp postgres /home/e-smith/db/pgsql/pgsql.dump
exec chpst -u postgres pg_dumpall
