postinst is in bind9-dyndb-ldap 11.1-3ubuntu1.
This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.
The actual contents of the file can be viewed below.
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 | #!/bin/bash
set -e
fix_named_conf() {
# The following sed script:
# - scopes the named.conf changes to dynamic-db
# - replaces arg "name value" syntax with name "value"
# - changes dynamic-db header to dyndb
# - uses the new way the define path to the library
# - removes no longer supported arguments (library, cache_ttl,
# psearch, serial_autoincrement, zone_refresh)
while read -r PATTERN
do
SEDSCRIPT+="$PATTERN"
done <<EOF
/^\s*dynamic-db/,/};/ {
s/\(\s*\)arg\s\+\(["']\)\([a-zA-Z_]\+\s\)/\1\3\2/g;
s/^dynamic-db/dyndb/;
s@\(dyndb "[^"]\+"\)@\1 "/usr/lib/bind/ldap.so"@;
s@\(dyndb '[^']\+'\)@\1 '/usr/lib/bind/ldap.so'@;
/\s*library[^;]\+;/d;
/\s*cache_ttl[^;]\+;/d;
/\s*psearch[^;]\+;/d;
/\s*serial_autoincrement[^;]\+;/d;
/\s*zone_refresh[^;]\+;/d;
}
EOF
sed -i.bak -e "$SEDSCRIPT" /etc/bind/named.conf
}
if [ $1 = "configure" ]; then
chown root:bind /var/cache/bind/dynamic /var/cache/bind/dyndb-ldap
chmod 0770 /var/cache/bind/dynamic /var/cache/bind/dyndb-ldap
if dpkg --compare-versions "$2" lt "11.1-3ubuntu1"; then
fix_named_conf
fi
fi
|