diff options
author | Mike Crute <mike@crute.us> | 2020-08-10 17:43:50 +0000 |
---|---|---|
committer | Mike Crute <mike@crute.us> | 2020-08-10 17:43:50 +0000 |
commit | 68694707ae2f80a647e64926cbf4cc66d71e96e5 (patch) | |
tree | 45f250960c8d470ee895285b2686402cf88fc7a3 /bind/entrypoint.sh | |
parent | 4a686fb5917145458c5d69f8c2f9d7988f86eea6 (diff) | |
download | dockerfiles-68694707ae2f80a647e64926cbf4cc66d71e96e5.tar.bz2 dockerfiles-68694707ae2f80a647e64926cbf4cc66d71e96e5.tar.xz dockerfiles-68694707ae2f80a647e64926cbf4cc66d71e96e5.zip |
bind: convert to config generation
Diffstat (limited to 'bind/entrypoint.sh')
-rwxr-xr-x | bind/entrypoint.sh | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/bind/entrypoint.sh b/bind/entrypoint.sh deleted file mode 100755 index 6ebb0f4..0000000 --- a/bind/entrypoint.sh +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | PROFILE="$1" | ||
4 | |||
5 | # The master is expected to provide its own complete config set | ||
6 | if [ "$PROFILE" = "slave" ]; then | ||
7 | if [ -z "$KEY_SECRET" ]; then | ||
8 | echo "KEY_SECRET must be exported into the environment" | ||
9 | exit 1 | ||
10 | fi | ||
11 | |||
12 | if [ -z "$KEY_NAME" ]; then | ||
13 | echo "KEY_NAME must be exported into the environment" | ||
14 | exit 1 | ||
15 | fi | ||
16 | |||
17 | if [ -z "$AWS_VPC_DNS" ]; then | ||
18 | echo "AWS_VPC_DNS must be exported into the environment" | ||
19 | exit 1 | ||
20 | fi | ||
21 | |||
22 | mkdir -p /etc/bind/local/cache/internal /etc/bind/local/cache/external | ||
23 | envsubst < /etc/bind/slave_zones.conf > /etc/bind/local/zones.conf | ||
24 | chown -R named:named /etc/bind/local | ||
25 | |||
26 | # Clean these up so that BIND never sees them | ||
27 | unset KEY_SECRET | ||
28 | unset KEY_NAME | ||
29 | unset AWS_VPC_DNS | ||
30 | fi | ||
31 | |||
32 | # This is used for RNDC and only from the current host, so just generate it | ||
33 | # fresh each container start. | ||
34 | ddns-confgen -q -k rndc-key > /etc/bind/rndc.key | ||
35 | chown named:named /etc/bind/rndc.key | ||
36 | chmod 440 /etc/bind/rndc.key | ||
37 | |||
38 | if [ "$PROFILE" = "slave" ]; then | ||
39 | exec /usr/sbin/named -u named -g | ||
40 | else | ||
41 | exec "$@" | ||
42 | fi | ||