Sophie

Sophie

distrib > Mageia > 5 > x86_64 > media > core-updates-src > by-pkgid > aacaa2977bdff010028249f0c6fc48d4 > files > 9

postgresql9.3-9.3.20-1.mga5.src.rpm

#! /bin/sh
# based on the init script for starting up the PostgreSQL server

PGDATA=$1

RETVAL=0

# Check for the PGDATA structure
if [ ! -f ${PGDATA}/PG_VERSION ]; then
	if [ ! -d ${PGDATA} ]; then
		mkdir -p ${PGDATA}
		chown postgres.postgres ${PGDATA}
		chmod go-rwx ${PGDATA}
	fi
	# Initialize the database
	/usr/bin/initdb --pgdata=${PGDATA} &>> /var/log/postgres/postgresql && test -f ${PGDATA}/PG_VERSION
	RETVAL=$?
	echo
fi
exit $RETVAL