May 17, 2026, 11:40 PM

This commit is contained in:
Paweł Domański
2026-05-18 06:40:19 +00:00
commit 64944cf004
896 changed files with 310709 additions and 0 deletions
@@ -0,0 +1,55 @@
#!/bin/bash
PORT=""
usage() {
echo "Usage: $0 [-p <port>]"
exit 1
}
while getopts "p:u" OPT;
do case "${OPT}" in
p) PORT="-p $OPTARG"
;;
u) usage
;;
[?]) usage
esac;
done
getver()
{
VER=$(psql $PORT -t -U postgres postgres <<_QRYVER_
SELECT version();
_QRYVER_
)
}
getver
VER=$(echo $VER | cut -c -16)
echo "Version is $VER"
slony_status() {
STATUS=$(psql $PORT -q <<_QUERY_
BEGIN;
SELECT st_origin as org,
st_last_event as last_event,
st_lag_num_events as lag_events,
st_lag_time
FROM _slony.sl_status;
COMMIT;
_QUERY_
)
}
slony_status
echo "${STATUS}"
exit 0