From 25b77f3fb49c26e3f19704e24eeaa1eeeeef1317 Mon Sep 17 00:00:00 2001 From: iSergio Date: Thu, 12 Apr 2018 10:09:57 +0300 Subject: [PATCH] Enter primary and standby host and defaults for them --- postgres/configure.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/postgres/configure.sh b/postgres/configure.sh index 8567502..e41a54e 100755 --- a/postgres/configure.sh +++ b/postgres/configure.sh @@ -14,14 +14,24 @@ if ! [[ $choice =~ ^([yY][eE][sS]]|[yY])$ ]]; then exit 0 fi +PRIMARY_HOST=172.16.0.104 +STANDBY_HOST=172.16.0.204 + cp bin/pg_* /usr/local/bin/ # Configure listen ip address -echo -n "Please, enter a ip address of PRIMARY server: " -read PRIMARY_HOST -echo -n "Please, enter a ip address of STANDBY server: " +echo -n "Please, enter a ip address of PRIMARY server(Default: $PRIMARY_HOST): " +read _PRIMARY_HOST +echo -n "Please, enter a ip address of STANDBY server(Default: $STANDBY_HOST) " read STANDBY_HOST +if [[ ! -z $_PRIMARY_HOST ]]; then + PRIMARY_HOST=$_PRIMARY_HOST +fi +if [[ ! -z $_STANDBY_HOST ]]; then + STANDBY_HOST=$_STANDBY_HOST +fi + sed -i 's/__PRIMARY_HOST__/'$PRIMARY_HOST'/g' /usr/local/bin/pg_replication sed -i 's/__STANDBY_HOST__/'$STANDBY_HOST'/g' /usr/local/bin/pg_replication -- GitLab