Use pg_lsclusters -h when figuring out the port to use

This commit is contained in:
Michael Banck 2020-03-20 21:33:51 +01:00
parent 3812c8d23b
commit af96198d16

View file

@ -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