diff --git a/postgres/configure.sh b/postgres/configure.sh index 856750209aead9e6233a2a70e50b961ce1a1ad8b..e41a54e401446d38886ffa2d139b789c9442f43b 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