-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprepare.sh
executable file
·62 lines (58 loc) · 3.95 KB
/
prepare.sh
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
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
mkdir -p /var/lib/docker-extvols/external-bird /var/lib/docker-extvols/internal-bird /var/lib/docker-extvols/balancer-bird
touch /var/lib/docker-extvols/balancer-bird/bird.log
touch /var/lib/docker-extvols/external-bird/bird.log
touch /var/lib/docker-extvols/internal-bird/bird.log
cat << EOF | base64 -d > /var/lib/docker-extvols/balancer-bird/bird.conf
bG9nICIvdmFyL2xvZy9iaXJkLmxvZyIgYWxsOwpkZWJ1ZyBwcm90b2NvbHMgYWxsOwoKcm91dGVy
IGlkIDE3Mi4yMC4yMC4yOwoKZmlsdGVyIHBlcm1pdF9leHRlcm5hbCB7CiAgICAgICAgaWYgbmV0
IH4gWyAxNzIuMzAuMTAuMC8yNCBdIHRoZW4gYWNjZXB0OwogICAgICAgIGVsc2UgcmVqZWN0Owp9
Cgpwcm90b2NvbCBkaXJlY3QgewogICAgICAgIGludGVyZmFjZSAiLWV0aCoiLCAiKiI7CiAgICAg
ICAgaXB2NDsKfQoKcHJvdG9jb2wga2VybmVsIHsKICAgICAgICBzY2FuIHRpbWUgMjA7CiAgICAg
ICAgaXB2NCB7CiAgICAgICAgICAgICAgICBpbXBvcnQgYWxsOwogICAgICAgICAgICAgICAgZXhw
b3J0IGFsbDsKICAgICAgICB9Owp9Cgpwcm90b2NvbCBkZXZpY2UgewogICAgICAgIHNjYW4gdGlt
ZSAxMDsKfQoKCnByb3RvY29sIHN0YXRpYyB7CiAgICAgICAgaXB2NDsKICAgICAgICByb3V0ZSAx
NzIuMzAuMTAuMC8yNCBibGFja2hvbGU7Cn0KCnByb3RvY29sIG9zcGYgRXh0ZXJuYWwgewogICAg
ICAgIHJmYzE1ODNjb21wYXQgeWVzOwogICAgICAgIGlwdjQgewogICAgICAgICAgICAgICAgaW1w
b3J0IGFsbDsKICAgICAgICAgICAgICAgIGV4cG9ydCBmaWx0ZXIgcGVybWl0X2V4dGVybmFsOwog
ICAgICAgIH07CiAgICAgICAgYXJlYSAxNzIuMzAuMC4wIHsKICAgICAgICAgICAgICAgIGludGVy
ZmFjZSAidmV0aDJleHRlcm5hbCIgewogICAgICAgICAgICAgICAgICAgIHR5cGUgcG9pbnRvcG9p
bnQ7CiAgICAgICAgICAgICAgICB9OwogICAgICAgIH07Cn0KCnByb3RvY29sIG9zcGYgSW50ZXJu
YWwgewogICAgICAgIHJmYzE1ODNjb21wYXQgeWVzOwogICAgICAgIGlwdjQgewogICAgICAgICAg
ICAgICAgaW1wb3J0IGFsbDsKICAgICAgICAgICAgICAgIGV4cG9ydCBub25lOwogICAgICAgIH07
CiAgICAgICAgYXJlYSAxNzIuMjUuMC4wIHsKICAgICAgICAgICAgICAgIGludGVyZmFjZSAidmV0
aDJpbnRlcm5hbCIgewogICAgICAgICAgICAgICAgICAgIHR5cGUgcG9pbnRvcG9pbnQ7CiAgICAg
ICAgICAgICAgICB9OwogICAgICAgIH07Cn0K
EOF
cat << EOF | base64 -d > /var/lib/docker-extvols/external-bird/bird.conf
bG9nICIvdmFyL2xvZy9iaXJkLmxvZyIgYWxsOwpkZWJ1ZyBwcm90b2NvbHMgYWxsOwoKcm91dGVy
IGlkIDE3Mi4yMC4yMC4xOwoKZmlsdGVyIHBlcm1pdF9leHRlcm5hbCB7CiAgICAgICAgaWYgbmV0
IH4gWyAxNzIuMzAuMC4wLzE2IF0gdGhlbiBhY2NlcHQ7CiAgICAgICAgZWxzZSByZWplY3Q7Cn0K
CnByb3RvY29sIGRpcmVjdCB7CiAgICAgICAgaW50ZXJmYWNlICItZXRoKiIsICIqIjsKICAgICAg
ICBpcHY0Owp9Cgpwcm90b2NvbCBrZXJuZWwgewogICAgICAgIHNjYW4gdGltZSAyMDsKICAgICAg
ICBpcHY0IHsKICAgICAgICAgICAgICAgIGltcG9ydCBhbGw7CiAgICAgICAgICAgICAgICBleHBv
cnQgYWxsOwogICAgICAgIH07Cn0KCnByb3RvY29sIGRldmljZSB7CiAgICAgICAgc2NhbiB0aW1l
IDEwOwp9Cgpwcm90b2NvbCBzdGF0aWMgewogICAgICAgIGlwdjQ7CiAgICAgICAgcm91dGUgMTcy
LjMwLjAuMC8xNiBibGFja2hvbGU7Cn0KCnByb3RvY29sIG9zcGYgQmFsYW5jZXIgewogICAgICAg
IHJmYzE1ODNjb21wYXQgeWVzOwogICAgICAgIGlwdjQgewogICAgICAgICAgICAgICAgaW1wb3J0
IGFsbDsKICAgICAgICAgICAgICAgIGV4cG9ydCBmaWx0ZXIgcGVybWl0X2V4dGVybmFsOwogICAg
ICAgIH07CiAgICAgICAgYXJlYSAxNzIuMzAuMC4wIHsKICAgICAgICAgICAgICAgIGludGVyZmFj
ZSAidmV0aDFleHRlcm5hbCIgewogICAgICAgICAgICAgICAgICAgIHR5cGUgcG9pbnRvcG9pbnQ7
CiAgICAgICAgICAgICAgICB9OwogICAgICAgIH07Cn0K
EOF
cat << EOF | base64 -d > /var/lib/docker-extvols/internal-bird/bird.conf
bG9nICIvdmFyL2xvZy9iaXJkLmxvZyIgYWxsOwpkZWJ1ZyBwcm90b2NvbHMgYWxsOwoKcm91dGVy
IGlkIDE3Mi4yMC4zMC4xOwoKZmlsdGVyIHBlcm1pdF9pbnRlcm5hbCB7CiAgICAgICAgaWYgbmV0
IH4gWyAxNzIuMjUuMC4wLzE2IF0gdGhlbiBhY2NlcHQ7CiAgICAgICAgZWxzZSByZWplY3Q7Cn0K
CnByb3RvY29sIGRpcmVjdCB7CiAgICAgICAgaW50ZXJmYWNlICItZXRoKiIsICIqIjsKICAgICAg
ICBpcHY0Owp9Cgpwcm90b2NvbCBrZXJuZWwgewogICAgICAgIHNjYW4gdGltZSAyMDsKICAgICAg
ICBpcHY0IHsKICAgICAgICAgICAgICAgIGltcG9ydCBhbGw7CiAgICAgICAgICAgICAgICBleHBv
cnQgYWxsOwogICAgICAgIH07Cn0KCnByb3RvY29sIGRldmljZSB7CiAgICAgICAgc2NhbiB0aW1l
IDEwOwp9CgoKcHJvdG9jb2wgc3RhdGljIHsKICAgICAgICBpcHY0OwogICAgICAgIHJvdXRlIDE3
Mi4yNS4wLjAvMTYgYmxhY2tob2xlOwp9Cgpwcm90b2NvbCBvc3BmIEJhbGFuY2VyIHsKICAgICAg
ICByZmMxNTgzY29tcGF0IHllczsKICAgICAgICBpcHY0IHsKICAgICAgICAgICAgICAgIGltcG9y
dCBhbGw7CiAgICAgICAgICAgICAgICBleHBvcnQgZmlsdGVyIHBlcm1pdF9pbnRlcm5hbDsKICAg
ICAgICB9OwogICAgICAgIGFyZWEgMTcyLjI1LjAuMCB7CiAgICAgICAgICAgICAgICBpbnRlcmZh
Y2UgInZldGgxaW50ZXJuYWwiIHsKICAgICAgICAgICAgICAgICAgICB0eXBlIHBvaW50b3BvaW50
OwogICAgICAgICAgICAgICAgfTsKICAgICAgICB9Owp9Cg==
EOF