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