From af96198d16fed03ec75a035a619b2e8ed87b521a Mon Sep 17 00:00:00 2001 From: Michael Banck Date: Fri, 20 Mar 2020 21:33:51 +0100 Subject: [PATCH] Use pg_lsclusters -h when figuring out the port to use --- debian/pg_createconfig_patroni | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/debian/pg_createconfig_patroni b/debian/pg_createconfig_patroni index 73ecee1..6fc8a7a 100755 --- a/debian/pg_createconfig_patroni +++ b/debian/pg_createconfig_patroni @@ -60,7 +60,7 @@ fi if [ -z "$PORT" ]; then # try to guess next free port - PORT=$(($(pg_lsclusters | tail -n +2 | awk '{print $3}' | sort -n | tail -1) + 1)) + PORT=$(($(pg_lsclusters -h | awk '{print $3}' | sort -n | tail -1) + 1)) if [ "$PORT" -eq 1 ]; then # No cluster exists yet, use default port PORT=5432