aboutsummaryrefslogtreecommitdiff
path: root/pgruntime/tool_template.sh
diff options
context:
space:
mode:
authorStefan Majewsky <majewsky@gmx.net>2026-07-30 19:57:29 +0200
committerStefan Majewsky <majewsky@gmx.net>2026-07-30 19:57:54 +0200
commit81e32cec36291685b59102594c714d235726e214 (patch)
tree9d9db69d96dc3cd1dd3ba58d60aefdc84b85e157 /pgruntime/tool_template.sh
parent7ead3465c7fdf564ae367e1169aeb68ced9267c8 (diff)
downloadgo-gg-81e32cec36291685b59102594c714d235726e214.tar.gz
add package pgruntime
Diffstat (limited to 'pgruntime/tool_template.sh')
-rw-r--r--pgruntime/tool_template.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/pgruntime/tool_template.sh b/pgruntime/tool_template.sh
new file mode 100644
index 0000000..d0ddea1
--- /dev/null
+++ b/pgruntime/tool_template.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+stop_postgres() {
+ EXIT_CODE=$?
+ pg_ctl stop --wait --silent -D .testdb/datadir
+ exit "${EXIT_CODE}"
+}
+trap stop_postgres EXIT INT TERM
+
+rm -f -- .testdb/run/postgresql.log
+pg_ctl start --wait --silent -D .testdb/datadir -l .testdb/run/postgresql.log
+$COMMAND -U postgres -h 127.0.0.1 -p 54320 "$@"