-
Notifications
You must be signed in to change notification settings - Fork 0
/
rm-buildPacemakerNoNetHost
executable file
·52 lines (37 loc) · 1.89 KB
/
rm-buildPacemakerNoNetHost
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
if [ "$1" == "" ]; then
nm=ttc
else
nm="$1"
fi
if [ ! -z /proc/sys/fs/binfmt_misc/register ]; then mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc; fi
if [ ! -z /proc/sys/fs/binfmt_misc/CLR ]; then echo ':CLR:M::MZ::/usr/bin/mono:' > /proc/sys/fs/binfmt_misc/register; fi
drm -f "$nm"
#docker run -dit --name "$nm" --cap-add=NET_ADMIN --net=host robotica/pcmk_ubuntu /sbin/my_init -- bash -l
docker run -dit --name "$nm" --privileged=true --cap-add=NET_ADMIN robotica/pcmk_ubuntu:test1 /sbin/my_init -- bash -l
docker exec -d "$nm" bash -c " if [ ! -z /proc/sys/fs/binfmt_misc/register ]; then mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc; fi"
#docker exec -d "$nm" bash -c " if [ ! -z /proc/sys/fs/binfmt_misc/CLR ]; then echo ':CLR:M::MZ::/usr/bin/mono:' > /proc/sys/fs/binfmt_misc/register; fi"
docker exec -d "$nm" ssh-keygen -q -t rsa -N '' -b 4096 -C "[email protected]" -f ~/.ssh/id_rsa
#docker exec -d "$nm" sed -i.bak -e s/#Port\ 22/Port\ 122/g /etc/ssh/sshd_config; cat /etc/ssh/sshd_config|grep \#Port
#docker exec -d "$nm" sed -i.bak -e s/#ListenAddress\ 0\.0\.0\.0/ListenAddress\ 192\.168\.123\.95/g /etc/ssh/sshd_config; cat /etc/ssh/sshd_config|grep ListenAddress
docker exec -d "$nm" sed -i.bak -e s/#ListenAddress\ 0\.0\.0\.0/ListenAddress\ 127\.0\.0\.1/g /etc/ssh/sshd_config; cat /etc/ssh/sshd_config|grep ListenAddress
#docker exec -d "$nm" echo "$nm" >> /whaoami
docker exec -d "$nm" bash -c "echo \"$nm\" >> /whoami"
docker exec "$nm" cat /whoami
docker exec "$nm" hostnamectl set-hostname xlbase-"$nm"
docker exec "$nm" /root/pcsd.sh
echo \[\!ID_DONE\]
if [ "$3" == "-s" ]; then
docker exec -d "$nm" service corosync start
sleep 6
docker exec -d "$nm" service pacemaker start
sleep 6
docker exec -d "$nm" pcs property set stonith-enabled=false
echo \[\!EX_DONE\]
fi
if [ "$4" == "--nobind" ]; then
echo No attach
else
echo $nm
dbind "$nm"
fi