#!/usr/bin/env bash
# Menghentikan kedua server demo streaming replication dan menghapus
# direktori datanya. Server utama course (socket 54329) tidak disentuh.
set -eu

PGBIN=/home/z/my-project/tools/dl/pgdeb/usr/lib/postgresql/17/bin
BASE=/home/z/my-project/tmp/rp_stream

"$PGBIN/pg_ctl" -D "$BASE/pgdata_cabang" -m fast stop >/dev/null 2>&1 || true
echo "standby berhenti"
"$PGBIN/pg_ctl" -D "$BASE/pgdata_pusat" -m fast stop >/dev/null 2>&1 || true
echo "primary berhenti"
rm -rf "$BASE"
echo "direktori data demo dihapus"
