summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2015-01-04 17:56:55 +0300
committerIgor Pashev <pashev.igor@gmail.com>2015-01-04 17:56:55 +0300
commit0e8a3cb136e41543b47eab6a6cf12144fad89c39 (patch)
treeb42ec3be9c91928e94343f4e4456bf75f972dcf1
parent6debcfa06e1f94be14f16c4eb786a48d53d7af6f (diff)
downloadbind9-0e8a3cb136e41543b47eab6a6cf12144fad89c39.tar.gz
Added debian/bind9.postinst.illumos
-rw-r--r--debian/bind9.postinst.illumos41
1 files changed, 41 insertions, 0 deletions
diff --git a/debian/bind9.postinst.illumos b/debian/bind9.postinst.illumos
new file mode 100644
index 00000000..15497be8
--- /dev/null
+++ b/debian/bind9.postinst.illumos
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+set -e
+
+if [ "$1" = configure ]; then
+ lastversion="$2";
+
+ getent group bind >/dev/null 2>&1 || addgroup --system bind
+ getent passwd bind >/dev/null 2>&1 ||
+ adduser --system --home /var/cache/bind --no-create-home \
+ --disabled-password --ingroup bind bind
+
+ if [ -z "$lastversion" ] ; then
+ mkdir -p /var/lib/bind
+ chown root:bind /var/lib/bind
+ chmod 775 /var/lib/bind
+ fi
+
+ if [ ! -s /etc/bind/rndc.key ] && [ ! -s /etc/bind/rndc.conf ]; then
+ rndc-confgen -r /dev/urandom -a
+ fi
+
+ if [ -z "$lastversion" ] ; then
+ if [ ! -f /etc/bind/named.conf.options ]; then
+ cp /usr/share/bind9/named.conf.options /etc/bind/named.conf.options
+ chmod 644 /etc/bind/named.conf.options
+ fi
+ fi
+ uid=$(ls -ln /etc/bind/rndc.key | awk '{print $3}')
+ if [ "$uid" = "0" ]; then
+ chown bind /etc/bind/rndc.key
+ chgrp bind /etc/bind
+ chmod g+s /etc/bind
+ chgrp bind /etc/bind/rndc.key /var/cache/bind
+ chgrp bind /etc/bind/named.conf* || true
+ chmod g+r /etc/bind/rndc.key /etc/bind/named.conf* || true
+ chmod g+rwx /var/cache/bind
+ fi
+fi
+
+#DEBHELPER#