Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/osdetection
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
10 changes: 9 additions & 1 deletion include/tests_firewalls
Original file line number Diff line number Diff line change
Expand Up @@ -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
#
Expand Down
4 changes: 2 additions & 2 deletions include/tests_kernel
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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
Expand Down