* debian/pg_createconfig_patroni: Exit gracefully if iproute2 is not
installed.
This commit is contained in:
parent
5d0a1b71cc
commit
69f8f7d410
2
debian/changelog
vendored
2
debian/changelog
vendored
|
@ -2,6 +2,8 @@ patroni (1.6.0-2) UNRELEASED; urgency=medium
|
||||||
|
|
||||||
[ Michael Banck ]
|
[ Michael Banck ]
|
||||||
* debian/control: Recommend iproute2.
|
* debian/control: Recommend iproute2.
|
||||||
|
* debian/pg_createconfig_patroni: Exit gracefully if iproute2 is not
|
||||||
|
installed.
|
||||||
|
|
||||||
-- Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org> Wed, 21 Aug 2019 13:18:29 +0200
|
-- Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org> Wed, 21 Aug 2019 13:18:29 +0200
|
||||||
|
|
||||||
|
|
16
debian/pg_createconfig_patroni
vendored
16
debian/pg_createconfig_patroni
vendored
|
@ -92,11 +92,23 @@ HOSTNAME=$(hostname)
|
||||||
|
|
||||||
# set default ipv4 address in case it was not provided
|
# set default ipv4 address in case it was not provided
|
||||||
if [ -z "$HOSTIP" ]; then
|
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)
|
if [ -x /bin/ip ]; then
|
||||||
|
HOSTIP=$(/bin/ip -4 route get 8.8.8.8 | grep ^8.8.8.8 | sed -e s/.*src.// -e s/\ .*//g)
|
||||||
|
else
|
||||||
|
echo "iproute2 package missing, cannot determine host ip addresss and --hostip is not set"
|
||||||
|
rm -f $CONFIG_FILE
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$NETWORK" ]; then
|
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
|
if [ -x /bin/ip ]; then
|
||||||
|
NETWORK=$(/bin/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
|
||||||
|
else
|
||||||
|
echo "iproute2 package missing, cannot determine network and --network is not set"
|
||||||
|
rm -f $CONFIG_FILE
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# add remaining patroni configuration from template
|
# add remaining patroni configuration from template
|
||||||
|
|
Loading…
Reference in a new issue