if grep "^postgres:x:" etc/passwd 1> /dev/null 2> /dev/null ; then
  true
else
  echo "postgres:x:28:28:PostgreSQL:/:" >> etc/passwd
  echo "postgres:*:9797:0:::::" >> etc/shadow
fi
if grep "^pgdb::" etc/group 1> /dev/null 2> /dev/null ; then
  true
else
  echo "pgdb::28:" >> etc/group
fi
if grep "pgsql" etc/rc.d/rc.M 1> /dev/null 2> /dev/null ; then
  true
else
cat <<eos >> etc/rc.d/rc.M

# Start the PostgreSQL server
if [ -x /etc/rc.d/rc.pgsql ]; then
  . /etc/rc.d/rc.pgsql
fi
eos

fi

( cd usr/bin ; rm -rf postmaster )
( cd usr/bin ; ln -sf postgres postmaster )
( cd usr/lib ; rm -rf libpq.so.3 )
( cd usr/lib ; ln -sf libpq.so.3.0 libpq.so.3 )
( cd usr/lib ; rm -rf libpq.so )
( cd usr/lib ; ln -sf libpq.so.3.0 libpq.so )
( cd usr/lib ; rm -rf libecpg.so.3 )
( cd usr/lib ; ln -sf libecpg.so.3.4.1 libecpg.so.3 )
( cd usr/lib ; rm -rf libecpg.so )
( cd usr/lib ; ln -sf libecpg.so.3.4.1 libecpg.so )
