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