-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildPacemaker3-192.168.123.
executable file
·52 lines (37 loc) · 1.75 KB
/
buildPacemaker3-192.168.123.
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 [ "$2" == "" ]; then
nm=ttc
else
nm="$2"
fi
if [ ! -e /proc/sys/fs/binfmt_misc/register ]; then mount binfmt_misc -t binfmt_misc /proc/sys/fs/binfmt_misc; fi
if [ ! -e /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" --privileged=true --cap-add=NET_ADMIN --net=host robotica/pcmk_ubuntu:0.5.0 /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\ 22/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\.$1/g /etc/ssh/sshd_config; cat /etc/ssh/sshd_config|grep ListenAddress
docker exec -d "$nm" rm /var/run/dbus/system_bus_socket
docker exec -d "$nm" service dbus start
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" bash -c "echo xlbase-\"$nm\" > /etc/hostname"
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