Mercurial Hosting > luan
comparison host/addStartupScriptsPostgres.sh @ 1632:0344a535b1db
add doc
| author | fffilimonov |
|---|---|
| date | Tue, 14 Dec 2021 07:41:01 +0000 |
| parents | |
| children | 665049cffc02 |
comparison
equal
deleted
inserted
replaced
| 1631:35c626c06dd5 | 1632:0344a535b1db |
|---|---|
| 1 #!/bin/bash | |
| 2 | |
| 3 SLAVE_IP=$1; | |
| 4 | |
| 5 mkdir -p $localStartup/postgres 2>/dev/null; | |
| 6 . startupScripts.sh; | |
| 7 | |
| 8 cd $startupPostgres; | |
| 9 for file in *.plist; do | |
| 10 log=${ROOTPWD}"/logs/startup.${file}.log"; | |
| 11 sed "s~PWD~${startup}~g;\ | |
| 12 s~LOG~${log}~g;\ | |
| 13 s~USER~${user}~g;\ | |
| 14 s~ROOT~${ROOTPWD}~g" $file > ${localStartup}/${file}; | |
| 15 done; | |
| 16 | |
| 17 cd ../; | |
| 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 addStartup; | |
| 28 | |
| 29 cd $ROOTPWD; |
