upgrade pgpool to 3.6.6
[pgpool-online-recovery] / streaming-replication.sh
index 87b5922..f3ca1e0 100755 (executable)
@@ -6,6 +6,8 @@ datadir=/var/lib/pgsql/9.6/data
 archivedir=/var/lib/pgsql/9.6/archive
 archivedirdest=/var/lib/pgsql/9.6/archive
 
+cd # if used as root with sudo -u postgres home dir won't be readable and we will get errors
+
 #Usage
 if [ "$1" = "" ] || [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ];
 then
@@ -156,7 +158,7 @@ StartLocalAndThenRemotePostGreSql () {
     fi
 
        echo -n "[INFO] Wating for replication to start "
-       while [ "`psql -c 'SELECT * from pg_stat_replication' -h 10.200.1.61 -t postgres postgres | wc -l`" -lt 2 ] ; do
+       while [ "`psql -c 'SELECT * from pg_stat_replication' -h $1 -t postgres postgres | wc -l`" -lt 2 ] ; do
                echo -n .
                sleep 1
        done