skip if already started

This commit is contained in:
celogeek 2022-05-21 19:00:06 +02:00
parent 97fbc64f78
commit f35c18027e
Signed by: celogeek
GPG Key ID: E6B7BDCFC446233A

View File

@ -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