File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -28,8 +28,11 @@ PGDATA=${DATA}/pg_data
28
28
export PGDATA
29
29
# export XDG_CONFIG_HOME=${DATA}/auto_failover
30
30
# export XDG_DATA_HOME=${DATA}/auto_failover
31
- # run_port=$(cat ${XDG_CONFIG_HOME}/pg_autoctl/${PGDATA}/pg_autoctl.cfg | grep -w port | cut -d "=" -f 2 | tr -d " ")
32
- run_port=$( cat ${PGDATA} /postgresql.conf | grep -w port | grep ' [0-9]' | tail -n 1 | cut -d ' =' -f 2 | cut -d " #" -f 1 | tr -d " " )
31
+ if [ " $PG_MODE " = monitor -o " $PG_MODE " = readwrite -o " $PG_MODE " = readonly ]; then
32
+ run_port=$( cat ${XDG_CONFIG_HOME} /pg_autoctl/${PGDATA} /pg_autoctl.cfg | grep -w port | cut -d " =" -f 2 | tr -d " " )
33
+ else
34
+ run_port=$( cat ${PGDATA} /postgresql.conf | grep -w port | grep ' [0-9]' | tail -n 1 | cut -d ' =' -f 2 | cut -d " #" -f 1 | tr -d " " )
35
+ fi
33
36
34
37
# run as postgres
35
38
if [ " $( id -u) " = ' 0' ]; then
You can’t perform that action at this time.
0 commit comments