]> git.madduck.net Git - code/gsc.git/blob - examples/nsd/nsd.conf-generator

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

remove/reserve unused ssh_opts parameter
[code/gsc.git] / examples / nsd / nsd.conf-generator
1 #!/bin/sh
2 #
3 # nsd.conf-generator — generate nsd.conf through interpolation
4 #
5 # Copyright © 2014 martin f. krafft <madduck@madduck.net>
6 # Released under the terms of the Artistic Licence 2.0
7 #
8 set -eu
9
10 PARAMS_FILE="$1";
11 if [ ! -r "$PARAMS_FILE" ]; then
12         echo >&2 "E: cannot read parameters from $PARAMS_FILE"
13         exit 1
14 fi
15 . $PARAMS_FILE
16
17 NSD_DIR=${0%/*}
18 [ "$NSD_DIR" = "." ] && NSD_DIR=${PWD}
19
20 exec cat <<_eof
21 server:
22         # uncomment to specify specific interfaces to bind (default all).
23         ip-address: 127.0.1.1
24         ip-address: $BIND_IPV4
25         ip-address: $BIND_IPV6
26
27         # don't answer VERSION.BIND and VERSION.SERVER CHAOS class queries
28         hide-version: yes
29
30         # identify the server (CH TXT ID.SERVER entry).
31         identity: "$IDENTITY"
32
33 # do not include subdir yet (cf. #772776)
34 #include: "$NSD_DIR/nsd.conf.d/*.conf"
35 include: "$NSD_DIR/zones.conf"
36 _eof