diff --git a/include/osdetection b/include/osdetection index 9386c8f77..9ac9c10a0 100644 --- a/include/osdetection +++ b/include/osdetection @@ -153,7 +153,7 @@ # Generic if [ -e /etc/os-release ]; then OS_FULLNAME=$(awk -F= '/^PRETTY_NAME=/ {print substr($2,2,length($2)-2)}' /etc/os-release) - OS_ID=$(grep "^ID=" /etc/os-release | awk -F= '{print $2}' | tr -d '"') + OS_ID=$(grep "^ID=" /etc/os-release | awk -F= '{print $2}' | tr -d "'\"" ) if [ -n "${OS_ID}" ]; then case ${OS_ID} in "almalinux") diff --git a/include/tests_firewalls b/include/tests_firewalls index 56f981a62..456a98e64 100644 --- a/include/tests_firewalls +++ b/include/tests_firewalls @@ -514,7 +514,15 @@ NFTABLES_ACTIVE=1 Report "firewall_software[]=nftables" else - LogText "Result: no nftables kernel module found" + FIND=$(${GREPBINARY} -ioP "(?<=/)nf*_tables(?=\.ko)" "/lib/modules/$(uname -r)/modules.builtin"); + if [ -n "${FIND}" ]; then + LogText "Result: found nftables kernel module" + FIREWALL_ACTIVE=1 + NFTABLES_ACTIVE=1 + Report "firewall_software[]=nftables" + else + LogText "Result: no nftables kernel module found" + fi fi fi # diff --git a/include/tests_kernel b/include/tests_kernel index 7fac8b591..7eebf28da 100644 --- a/include/tests_kernel +++ b/include/tests_kernel @@ -748,7 +748,7 @@ # Extra current kernel version and replace dashes to allow numeric ${SORTBINARY} later on MYKERNEL=$(${UNAMEBINARY} -r | ${SEDBINARY} 's/\.[a-z].*.//g' | ${SEDBINARY} 's/-[a-z].*.//g' | ${SEDBINARY} 's/-/./g') LogText "Result: using ${MYKERNEL} as my kernel version (stripped)" - FIND=$(ls ${ROOTDIR}boot/vmlinuz* 2> /dev/null) + FIND=$(${FINDBINARY} /boot/ /boot/EFI/Gentoo/ -maxdepth 1 -name "vmlinuz*") if [ -n "${FIND}" ]; then for ITEM in ${FIND}; do LogText "Result: found ${ITEM}" @@ -757,7 +757,7 @@ # Ignore rescue images. Remove generic. and huge. for Slackware machines # TODO: see if this can be simplified using ls -v sorting LogText "Action: checking relevant kernels" - KERNELS=$(${LSBINARY} /boot/vmlinuz* | ${GREPBINARY} -v rescue | ${SEDBINARY} 's/vmlinuz-//' | ${SEDBINARY} 's/generic.//' | ${SEDBINARY} 's/huge.//' | ${SEDBINARY} 's/\.[a-z].*.//g' | ${SEDBINARY} 's/-[a-z].*.//g' | ${SEDBINARY} 's./boot/..' | ${SEDBINARY} 's/-/./g' | ${SORTBINARY} -n -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 -k6,6 -t \.) + KERNELS=$(${FINDBINARY} /boot/ /boot/EFI/Gentoo/ -maxdepth 1 -name "vmlinuz*" | ${GREPBINARY} -v rescue | ${SEDBINARY} 's/vmlinuz-//' | ${SEDBINARY} 's/generic.//' | ${SEDBINARY} 's/huge.//' | ${SEDBINARY} 's/\.[a-z].*.//g' | ${SEDBINARY} 's/-[a-z].*.//g' | ${SEDBINARY} 's./boot/..' | ${SEDBINARY} 's.EFI/Gentoo/..' | ${SEDBINARY} 's/-/./g' | ${SORTBINARY} -n -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 -k6,6 -t \.) KERNELS_ONE_LINE=$(${ECHOCMD} ${KERNELS} | ${TRBINARY} '\n' ' ') LogText "Output: ${KERNELS_ONE_LINE}" elif [ ! "$(ls ${ROOTDIR}boot/kernel* 2> /dev/null)" = "" ]; then