comparison host/addStartupScripts.sh @ 1631:35c626c06dd5

add startup scripts for mac os
author fffilimonov
date Mon, 13 Dec 2021 09:14:52 +0000
parents
children 0344a535b1db
comparison
equal deleted inserted replaced
1630:b735ed134662 1631:35c626c06dd5
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;