3-startdb.sh (428B)
1 #!/bin/bash 2 set -evux 3 PG_BIN=$(pg_config --bindir) 4 PG_ETC=$(pg_config --sharedir | sed 's|/usr/share/postgresql|/etc/postgresql|') 5 export PGPORT=5432 6 7 sudo -u postgres "${PG_BIN}/pg_ctl" \ 8 start \ 9 -D ${PG_ETC}/main \ 10 -o "-h localhost -p $PGPORT" 11 sleep 10 12 sudo -u postgres createuser -p "$PGPORT" root 13 sudo -u postgres createdb -p "$PGPORT" -O root challengercheck 14 sudo -u postgres createdb -p "$PGPORT" -O root talercheck