annotate host/macos/addStartupScriptsPostgres.sh @ 1647:7eddf1e990c0

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 22 Mar 2022 09:00:59 -0700
parents f53301a50084
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
1 #!/bin/bash
0344a535b1db add doc
fffilimonov
parents:
diff changeset
2
0344a535b1db add doc
fffilimonov
parents:
diff changeset
3 SLAVE_IP=$1;
1638
f53301a50084 use default slave ip
fffilimonov
parents: 1635
diff changeset
4
f53301a50084 use default slave ip
fffilimonov
parents: 1635
diff changeset
5 if [ "$1" == "" ]; then
f53301a50084 use default slave ip
fffilimonov
parents: 1635
diff changeset
6 SLAVE_IP="127.0.0.1";
f53301a50084 use default slave ip
fffilimonov
parents: 1635
diff changeset
7 fi;
f53301a50084 use default slave ip
fffilimonov
parents: 1635
diff changeset
8
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
9 . startupScripts.sh;
1633
665049cffc02 fix path
fffilimonov
parents: 1632
diff changeset
10 mkdir -p $localStartup"/postgres" 2>/dev/null;
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
11
0344a535b1db add doc
fffilimonov
parents:
diff changeset
12 cd $startupPostgres;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
13 for file in *.plist; do
0344a535b1db add doc
fffilimonov
parents:
diff changeset
14 log=${ROOTPWD}"/logs/startup.${file}.log";
0344a535b1db add doc
fffilimonov
parents:
diff changeset
15 sed "s~PWD~${startup}~g;\
0344a535b1db add doc
fffilimonov
parents:
diff changeset
16 s~LOG~${log}~g;\
0344a535b1db add doc
fffilimonov
parents:
diff changeset
17 s~USER~${user}~g;\
0344a535b1db add doc
fffilimonov
parents:
diff changeset
18 s~ROOT~${ROOTPWD}~g" $file > ${localStartup}/${file};
0344a535b1db add doc
fffilimonov
parents:
diff changeset
19 done;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
20
1635
fd3d56f39450 rearrange startup files
Franklin Schmidt <fschmidt@gmail.com>
parents: 1633
diff changeset
21 cd $ROOTPWD/startup/postgres;
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
22
1633
665049cffc02 fix path
fffilimonov
parents: 1632
diff changeset
23 cp postgresql.conf ${localStartup}/postgres/postgresql.conf;
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
24 mv /usr/local/var/postgresql@9.5/postgresql.conf /usr/local/var/postgresql@9.5/postgresql.conf.bak;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
25 ln -sf ${localStartup}/postgres/postgresql.conf /usr/local/var/postgresql@9.5/postgresql.conf;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
26
1633
665049cffc02 fix path
fffilimonov
parents: 1632
diff changeset
27 sed "s/SLAVE_IP/${SLAVE_IP}/g" pg_hba.conf > ${localStartup}/postgres/pg_hba.conf;
1632
0344a535b1db add doc
fffilimonov
parents:
diff changeset
28 mv /usr/local/var/postgresql@9.5/pg_hba.conf /usr/local/var/postgresql@9.5/pg_hba.conf.bak;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
29 ln -sf ${localStartup}/postgres/pg_hba.conf /usr/local/var/postgresql@9.5/pg_hba.conf;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
30
0344a535b1db add doc
fffilimonov
parents:
diff changeset
31 addStartup;
0344a535b1db add doc
fffilimonov
parents:
diff changeset
32
0344a535b1db add doc
fffilimonov
parents:
diff changeset
33 cd $ROOTPWD;