#!/bin/sh

rm -rf /tmp/ngmp
mkdir /tmp/ngmp
chown -R ngmp:ngmp /tmp/ngmp
rm -rf /usr/local/ngmp/users

/usr/local/etc/rc.d/postgresql restart
/usr/local/etc/rc.d/apache22 restart
su pgsql -c 'dropdb ngmp'
su pgsql -c 'dropuser ngmp'
su pgsql -c 'createuser -SDR ngmp'
su pgsql -c 'createdb -O ngmp ngmp'
su pgsql -c 'createlang plpgsql ngmp'
psql -U ngmp ngmp < ngmp.sql
