Skip to content

Instantly share code, notes, and snippets.

@twonds
Created January 21, 2016 17:57
Show Gist options
  • Save twonds/b2f71418d17e09119259 to your computer and use it in GitHub Desktop.
Save twonds/b2f71418d17e09119259 to your computer and use it in GitHub Desktop.
#!/bin/bash
PGSQL_DIR=/usr/local/pgsql
export PGDATA=${PGSQL_DIR}/data
if [ ! -e ${PGDATA}/PG_VERSION ]
then
initdb -D ${PGDATA}
fi
echo ${PGSQL_DIR}
postgres -D ${PGDATA} > ${PGSQL_DIR}/logfile 2>&1 &
echo $! > ${PGSQL_DIR}/pg.pid
cat ${PGSQL_DIR}/pg.pid
cat ${PGSQL_DIR}/logfile
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment