annotate 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
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1631
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
1 #!/bin/bash
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
2
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
3 . startupScripts.sh;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
4
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
5 mkdir -p $localStartup 2>/dev/null;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
6 mkdir -p $localStartup/postgres 2>/dev/null;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
7
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
8 cleanUp;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
9
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
10 cd $startup;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
11 for file in *.plist; do
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
12 log=${ROOTPWD}"/logs/startup.${file}.log";
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
13 sed "s~PWD~${startup}~g;\
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
14 s~LOG~${log}~g;\
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
15 s~USER~${user}~g;\
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
16 s~ROOT~${ROOTPWD}~g" $file > ${localStartup}/${file};
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
17 done;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
18
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
19 cp postgres/postgresql.conf ${localStartup}/postgres/postgresql.conf;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
20 mv /usr/local/var/postgresql@9.5/postgresql.conf /usr/local/var/postgresql@9.5/postgresql.conf.bak;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
21 ln -sf ${localStartup}/postgres/postgresql.conf /usr/local/var/postgresql@9.5/postgresql.conf;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
22
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
23 sed "s/SLAVE_IP/${SLAVE_IP}/g" postgres/pg_hba.conf > ${localStartup}/postgres/pg_hba.conf;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
24 mv /usr/local/var/postgresql@9.5/pg_hba.conf /usr/local/var/postgresql@9.5/pg_hba.conf.bak;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
25 ln -sf ${localStartup}/postgres/pg_hba.conf /usr/local/var/postgresql@9.5/pg_hba.conf;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
26
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
27 cd $localStartup;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
28 for file in *.plist; do
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
29 sudo ln -sf ${localStartup}/${file} ${systemStarup}/${file};
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
30 sudo chown root:wheel ${localStartup}/${file};
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
31 done;
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
32
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
33
35c626c06dd5 add startup scripts for mac os
fffilimonov
parents:
diff changeset
34 cd $ROOTPWD;