diff --git a/lib/utils.sh b/lib/utils.sh index 46393be..b4339c2 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -22,14 +22,21 @@ is_centos_8() is_debian_ge_10() { + # For debian11 + DEBIAN11CODENAME="bullseye" if [ -r /etc/debian_version ]; then - if [ $(cat /etc/debian_version | awk -F"." '{print $1}') -ge 10 ]; then - debug "Debian version is greater than or equal to 10" - FNRET=0 - else - debug "Debian version is less than 10" - FNRET=1 - fi + if [ $(grep -cw "^$DEBIAN11CODENAME" /etc/debian_version) -eq 1 ]; then + debug "Debian version is greater than or equal to 10" + FNRET=0 + return + fi + if [ $(cat /etc/debian_version | awk -F"." '{print $1}') -ge 10 ]; then + debug "Debian version is greater than or equal to 10" + FNRET=0 + else + debug "Debian version is less than 10" + FNRET=1 + fi else debug "Current OS is not Debian." FNRET=2 @@ -38,14 +45,21 @@ is_debian_ge_10() is_debian_ge_9() { + # For debian11 + DEBIAN11CODENAME="bullseye" if [ -r /etc/debian_version ]; then - if [ $(cat /etc/debian_version | awk -F"." '{print $1}') -ge 9 ]; then - debug "Debian version is greater than or equal to 9" - FNRET=0 - else - debug "Debian version is less than 9" - FNRET=1 - fi + if [ $(grep -cw "^$DEBIAN11CODENAME" /etc/debian_version) -eq 1 ]; then + debug "Debian version is greater than or equal to 10" + FNRET=0 + return + fi + if [ $(cat /etc/debian_version | awk -F"." '{print $1}') -ge 9 ]; then + debug "Debian version is greater than or equal to 9" + FNRET=0 + else + debug "Debian version is less than 9" + FNRET=1 + fi else debug "Current OS is not Debian." FNRET=2