feat(\db-tool\): introduce unified db-tool package with postgres harness and tests (T0-T8)
This commit is contained in:
14
package/db-tool/postgres-cleanup.sh
Normal file
14
package/db-tool/postgres-cleanup.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/dash
|
||||
|
||||
postgres_cleanup_main() {
|
||||
if [ -z "${PG_WORKING_DIR:-}" ] && [ -z "${LOCAL_DIR:-}" ]; then return 0; fi
|
||||
: "${PG_WORKING_DIR:=$LOCAL_DIR/focus/postgresql}"
|
||||
if [ -f "${PG_WORKING_DIR}/data/postmaster.pid" ]; then
|
||||
pg_ctl -D "${PG_WORKING_DIR}/data" -m fast -w stop || :
|
||||
fi
|
||||
return 0
|
||||
}
|
||||
|
||||
if [ "$(basename "$0")" = 'postgres-cleanup' ]; then
|
||||
postgres_cleanup_main "$@"
|
||||
fi
|
||||
Reference in New Issue
Block a user