Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates-src > by-pkgid > 1985747b841a88306d1680005cafb573 > files > 8

postgresql9.6-9.6.13-3.mga6.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 --encoding UTF8 --locale=C --pgdata=${PGDATA} &>> /var/log/postgres/postgresql && test -f ${PGDATA}/PG_VERSION
	RETVAL=$?
	echo
fi
exit $RETVAL