comparison host/addStartupScripts.sh @ 1632:0344a535b1db

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