skip if already started
This commit is contained in:
parent
97fbc64f78
commit
f35c18027e
@ -1,4 +1,10 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
if [ -f data/db/postmaster.pid ]
|
||||||
|
then
|
||||||
|
echo "already started"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
INIT=0
|
INIT=0
|
||||||
if [ ! -d data/db ]
|
if [ ! -d data/db ]
|
||||||
then
|
then
|
||||||
@ -6,7 +12,9 @@ then
|
|||||||
initdb --locale=C -E UTF-8 data/db
|
initdb --locale=C -E UTF-8 data/db
|
||||||
INIT=1
|
INIT=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
pg_ctl -D data/db -l data/db.log start
|
pg_ctl -D data/db -l data/db.log start
|
||||||
|
|
||||||
if [ "$INIT" == "1" ]
|
if [ "$INIT" == "1" ]
|
||||||
then
|
then
|
||||||
sleep 2
|
sleep 2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user