* debian/pg_createconfig_patroni: Fix determination of host IP/network if `ip

route get' reports additional output (Closes: #930015).
This commit is contained in:
Michael Banck 2019-06-05 11:09:30 +02:00
parent d2c87e9e76
commit 3d12adbb69
2 changed files with 4 additions and 2 deletions

2
debian/changelog vendored
View file

@ -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 <team+postgresql@tracker.debian.org> Sat, 16 Feb 2019 07:30:36 +0100

View file

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