freebsd-ports/databases/postgresql92-server/pkg-install-server
Palle Girgensohn 2cc30ceb2a Remove bad "BETA" alert. This is not beta anymore.
Set update_process_title = off, as suggested by kris@ and others.
2008-02-18 12:55:02 +00:00

63 lines
1.3 KiB
Bash

#! /bin/sh
# $FreeBSD$
PATH=/bin:/usr/bin:/usr/sbin
backupwarning() { echo "
=========== BACKUP YOUR DATA! =============
As always, backup your data before
upgrading. If the upgrade leads to a higher
minor revision (e.g. 7.3.x -> 7.4), a dump
and restore of all databases is
required. This is *NOT* done by the port!
Press ctrl-C *now* if you need to pg_dump.
===========================================
"
sleep 5
}
case $2 in
PRE-INSTALL)
backupwarning
PGUSER=${PGUSER:-pgsql}
PGGROUP=${PGGROUP:-pgsql}
DB_DIR=${PKG_PREFIX}/${PGUSER}
UID=70
GID=70
if pw group show "${PGGROUP}" 2>/dev/null; then
echo "You already have a group \"${PGGROUP}\", so I will use it."
else
if pw groupadd ${PGGROUP} -g ${GID}; then
echo "Added group \"${PGGROUP}\"."
else
echo "Adding group \"${PGGROUP}\" failed..."
exit 1
fi
fi
if pw user show "${PGUSER}" 2>/dev/null; then
echo "You already have a user \"${PGUSER}\", so I will use it."
else
if pw useradd ${PGUSER} -u ${UID} -g ${PGGROUP} -h - \
-d ${DB_DIR} -c "PostgreSQL Daemon"
then
echo "Added user \"${PGUSER}\"."
else
echo "Adding user \"${PGUSER}\" failed..."
exit 1
fi
fi
if ! [ -x ~${PGUSER} ] ; then
install -m 755 -o ${PGUSER} -g ${PGGROUP} -d ${DB_DIR}
fi
;;
BACKUPWARNING)
backupwarning
;;
esac