From 3d12adbb69e561504e2bbf673132ae79dabb8124 Mon Sep 17 00:00:00 2001 From: Michael Banck Date: Wed, 5 Jun 2019 11:09:30 +0200 Subject: [PATCH] * debian/pg_createconfig_patroni: Fix determination of host IP/network if `ip route get' reports additional output (Closes: #930015). --- debian/changelog | 2 ++ debian/pg_createconfig_patroni | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/debian/changelog b/debian/changelog index d3222e2..cf0cea0 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ patroni (1.5.5-2) UNRELEASED; urgency=medium [ Michael Banck ] * debian/pg_createconfig_patroni: Filter out comments from /etc/patroni/dcs.yml when assembling the Patroni configuration file. + * debian/pg_createconfig_patroni: Fix determination of host IP/network if `ip + route get' reports additional output (Closes: #930015). -- Debian PostgreSQL Maintainers Sat, 16 Feb 2019 07:30:36 +0100 diff --git a/debian/pg_createconfig_patroni b/debian/pg_createconfig_patroni index 0688ac6..739ad69 100755 --- a/debian/pg_createconfig_patroni +++ b/debian/pg_createconfig_patroni @@ -92,11 +92,11 @@ HOSTNAME=$(hostname) # set default ipv4 address in case it was not provided if [ -z "$HOSTIP" ]; then - HOSTIP=$(ip -4 route get 8.8.8.8 | grep ^8.8.8.8 | sed -e s/.*src.// -e s/\ //g) + HOSTIP=$(ip -4 route get 8.8.8.8 | grep ^8.8.8.8 | sed -e s/.*src.// -e s/\ .*//g) fi if [ -z "$NETWORK" ]; then - NETWORK=$(ip -4 route get 8.8.8.8 | grep ^8.8.8.8 | sed -e s/.*src.// -e s/\ //g -e s/\.[0-9]*$/.0/)/24 + NETWORK=$(ip -4 route get 8.8.8.8 | grep ^8.8.8.8 | sed -e s/.*src.// -e s/\ .*//g -e s/\.[0-9]*$/.0/)/24 fi # add remaining patroni configuration from template