Mercurial Hosting > luan
comparison host/addStartupScriptsPostgres.sh @ 1633:665049cffc02
fix path
author | fffilimonov |
---|---|
date | Tue, 14 Dec 2021 07:55:47 -0600 |
parents | 0344a535b1db |
children |
comparison
equal
deleted
inserted
replaced
1632:0344a535b1db | 1633:665049cffc02 |
---|---|
1 #!/bin/bash | 1 #!/bin/bash |
2 | 2 |
3 SLAVE_IP=$1; | 3 SLAVE_IP=$1; |
4 | |
5 mkdir -p $localStartup/postgres 2>/dev/null; | |
6 . startupScripts.sh; | 4 . startupScripts.sh; |
5 mkdir -p $localStartup"/postgres" 2>/dev/null; | |
7 | 6 |
8 cd $startupPostgres; | 7 cd $startupPostgres; |
9 for file in *.plist; do | 8 for file in *.plist; do |
10 log=${ROOTPWD}"/logs/startup.${file}.log"; | 9 log=${ROOTPWD}"/logs/startup.${file}.log"; |
11 sed "s~PWD~${startup}~g;\ | 10 sed "s~PWD~${startup}~g;\ |
14 s~ROOT~${ROOTPWD}~g" $file > ${localStartup}/${file}; | 13 s~ROOT~${ROOTPWD}~g" $file > ${localStartup}/${file}; |
15 done; | 14 done; |
16 | 15 |
17 cd ../; | 16 cd ../; |
18 | 17 |
19 cp postgres/postgresql.conf ${localStartup}/postgres/postgresql.conf; | 18 cp 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; | 19 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; | 20 ln -sf ${localStartup}/postgres/postgresql.conf /usr/local/var/postgresql@9.5/postgresql.conf; |
22 | 21 |
23 sed "s/SLAVE_IP/${SLAVE_IP}/g" postgres/pg_hba.conf > ${localStartup}/postgres/pg_hba.conf; | 22 sed "s/SLAVE_IP/${SLAVE_IP}/g" 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; | 23 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; | 24 ln -sf ${localStartup}/postgres/pg_hba.conf /usr/local/var/postgresql@9.5/pg_hba.conf; |
26 | 25 |
27 addStartup; | 26 addStartup; |
28 | 27 |