summaryrefslogtreecommitdiff
path: root/testing/bind/install
diff options
context:
space:
mode:
authorroot <root@rshg054.dnsready.net>2012-06-06 00:01:34 +0000
committerroot <root@rshg054.dnsready.net>2012-06-06 00:01:34 +0000
commit91734dee3e97f809fb0fcf7add40f7af90fccd87 (patch)
tree5ea3c4fcb1f01ef60e6f841415bd5f7ab78e32f0 /testing/bind/install
parent67db4cf68dbdb364c4dee1599294d7701f3c3b0a (diff)
Wed Jun 6 00:01:34 UTC 2012
Diffstat (limited to 'testing/bind/install')
-rw-r--r--testing/bind/install21
1 files changed, 21 insertions, 0 deletions
diff --git a/testing/bind/install b/testing/bind/install
new file mode 100644
index 000000000..287d0e05b
--- /dev/null
+++ b/testing/bind/install
@@ -0,0 +1,21 @@
+post_install() {
+ getent group named &>/dev/null || groupadd -g 40 named
+ getent passwd named &>/dev/null || useradd -u 40 -c "BIND DNS Server" -g named -d /var/named -s /bin/false named
+ passwd -l named &>/dev/null
+
+ touch var/log/named.log
+ chown named:named var/log/named.log
+
+ # create an rndc.key if it doesn't already exist
+ if [[ ! -s etc/rndc.key ]]; then
+ usr/sbin/rndc-confgen -r /dev/urandom -b 256 | head -n 5 >>etc/rndc.key
+ chown root:named etc/rndc.key
+ chmod 640 etc/rndc.key
+ fi
+}
+
+pre_remove() {
+ getent passwd named &>/dev/null && userdel named >/dev/null
+ getent group named &>/dev/null && groupdel named >/dev/null
+ return 0
+}