2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-08-21 18:50:28 +00:00

Fix bind version comparison

This commit is contained in:
Mark Gurevich
2023-03-01 10:25:20 -05:00
parent f8ffdd86cc
commit 1098e6943b

View File

@@ -63,8 +63,19 @@ do
echo " $i;"
done >>$FILE
echo " };" >>$FILE
# Natural version compare against version of bind.
# If version 9.16.6 or higher, turn off DNSSEC
BIND_VERSION=$(/usr/sbin/named -v | cut -d" " -f2)
if [[ $BIND_VERSION > "9.16.5" ]]; then
CONTROL_BIND_VERSION="9.16.6"
# "sort --version-sort" takes lines of version strings and sorts them.
# Output is lines of versions in sorted order, last line is highest version number
LAST_IN_COMPARE=`printf '%s\n' $BIND_VERSION $CONTROL_BIND_VERSION | sort --version-sort | tail -n1`
if [ $BIND_VERSION = $LAST_IN_COMPARE ]; then
# current version of BIND was last in sorted order,
# therefor it is higher than CONTROL_BIND_VERSION
echo " dnssec-enable no;
dnssec-validation no;" >>$FILE
fi