* debian/pg_creatconfig_patroni: Remove --scope option in favor of
pg_createcluster's regular "[options] <version> <cluster name>" syntax.
This commit is contained in:
parent
a5a0313dfd
commit
9dac6883f9
4
debian/changelog
vendored
4
debian/changelog
vendored
|
@ -1,6 +1,8 @@
|
|||
patroni (1.5.4-7) UNRELEASED; urgency=medium
|
||||
|
||||
*
|
||||
[ Michael Banck ]
|
||||
* debian/pg_creatconfig_patroni: Remove --scope option in favor of
|
||||
pg_createcluster's regular "[options] <version> <cluster name>" syntax.
|
||||
|
||||
-- Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org> Mon, 04 Feb 2019 21:12:35 +0100
|
||||
|
||||
|
|
31
debian/pg_createconfig_patroni
vendored
31
debian/pg_createconfig_patroni
vendored
|
@ -3,10 +3,6 @@
|
|||
for i in "$@"
|
||||
do
|
||||
case $i in
|
||||
--scope=*)
|
||||
SCOPE="${i#*=}"
|
||||
shift # past argument=value
|
||||
;;
|
||||
--hostip=*)
|
||||
HOSTIP="${i#*=}"
|
||||
shift # past argument=value
|
||||
|
@ -29,11 +25,34 @@ case $i in
|
|||
esac
|
||||
done
|
||||
|
||||
if [ -z "$SCOPE" ]; then
|
||||
echo "Required option --scope missing"
|
||||
if [ -z "$2" ];
|
||||
then
|
||||
echo "Usage: pg_creatconfig_patroni [options] <version> <cluster name>"
|
||||
exit 1
|
||||
else
|
||||
VERSION=$1
|
||||
echo $VERSION | egrep -q '^[[:digit:]]+\.?[[:digit:]]+$'
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "Error: invalid version ${VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
if [ ! -f /usr/lib/postgresql/${VERSION}/bin/initdb ]; then
|
||||
echo "Error: no initdb program for version ${VERSION} found"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -z "$2" ];
|
||||
then
|
||||
echo "Usage: pg_creatconfig_patroni [options] <version> <cluster name>"
|
||||
exit 1
|
||||
else
|
||||
CLUSTER=$2
|
||||
fi
|
||||
|
||||
echo "Version: $VERSION, Cluster: $CLUSTER"
|
||||
exit 0
|
||||
|
||||
if [ -z "$PORT" ]; then
|
||||
# try to guess next free port
|
||||
PORT=$(($(pg_lsclusters | awk '{print $3}' | grep -v Port | sort -n | tail -1) + 1))
|
||||
|
|
Loading…
Reference in a new issue