# Transform named.conf if it still has old-style API.PLATFORM=$(uname-m)
if[$PLATFORM=="x86_64"];then
LIBPATH=/usr/lib64
else
LIBPATH=/usr/lib
fi
# 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)whileread-rPATTERN
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 "$LIBPATH/bind/ldap.so"@;s@\(dyndb'[^']\+'\)@\1 '$LIBPATH/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--follow-symlinks-e"$SEDSCRIPT"/etc/named.conf
# restart bind due to upgrade issue caused by binary incompatibility# of new installed version of bind and old not removed yet version of# dyndb ldapsystemctlis-enabled--quietbind&&systemctlrestartbind2>&1||:
# actually, FreeIPA installer disables all depended services to# explicitly control them via ipa.service/ipactl. Therefore in this# case named is always in disabled state.systemctlis-enabled--quietipa&&systemctlrestartbind2>&1||: