1632
|
1 #!/bin/bash
|
|
2
|
|
3 SLAVE_IP=$1;
|
|
4 . startupScripts.sh;
|
1633
|
5 mkdir -p $localStartup"/postgres" 2>/dev/null;
|
1632
|
6
|
|
7 cd $startupPostgres;
|
|
8 for file in *.plist; do
|
|
9 log=${ROOTPWD}"/logs/startup.${file}.log";
|
|
10 sed "s~PWD~${startup}~g;\
|
|
11 s~LOG~${log}~g;\
|
|
12 s~USER~${user}~g;\
|
|
13 s~ROOT~${ROOTPWD}~g" $file > ${localStartup}/${file};
|
|
14 done;
|
|
15
|
|
16 cd ../;
|
|
17
|
1633
|
18 cp postgresql.conf ${localStartup}/postgres/postgresql.conf;
|
1632
|
19 mv /usr/local/var/postgresql@9.5/postgresql.conf /usr/local/var/postgresql@9.5/postgresql.conf.bak;
|
|
20 ln -sf ${localStartup}/postgres/postgresql.conf /usr/local/var/postgresql@9.5/postgresql.conf;
|
|
21
|
1633
|
22 sed "s/SLAVE_IP/${SLAVE_IP}/g" pg_hba.conf > ${localStartup}/postgres/pg_hba.conf;
|
1632
|
23 mv /usr/local/var/postgresql@9.5/pg_hba.conf /usr/local/var/postgresql@9.5/pg_hba.conf.bak;
|
|
24 ln -sf ${localStartup}/postgres/pg_hba.conf /usr/local/var/postgresql@9.5/pg_hba.conf;
|
|
25
|
|
26 addStartup;
|
|
27
|
|
28 cd $ROOTPWD;
|