mirror of
https://github.com/CISOfy/lynis.git
synced 2025-07-28 16:24:13 +02:00
Update tests_kernel -> KRNL-5622
Fix runlevel detection for SO without systemd (eg. Slackware)
This commit is contained in:
parent
fa7851e513
commit
42f0b05d10
@ -39,11 +39,9 @@
|
|||||||
# Description : Check default run level on Linux machines
|
# Description : Check default run level on Linux machines
|
||||||
Register --test-no KRNL-5622 --os Linux --weight L --network NO --category security --description "Determine Linux default run level"
|
Register --test-no KRNL-5622 --os Linux --weight L --network NO --category security --description "Determine Linux default run level"
|
||||||
if [ ${SKIPTEST} -eq 0 ]; then
|
if [ ${SKIPTEST} -eq 0 ]; then
|
||||||
# Only run if systemctl binary is available
|
|
||||||
if [ -n "${SYSTEMCTLBINARY}" ]; then
|
|
||||||
# Checking if we can find the systemd default target
|
# Checking if we can find the systemd default target
|
||||||
LogText "Test: Checking for systemd default.target"
|
LogText "Test: Checking for systemd default.target"
|
||||||
if [ $(${SYSTEMCTLBINARY} get-default) ]; then
|
if [ $( [ ! -z ${SYSTEMCTLBINARY} ] && ${SYSTEMCTLBINARY} get-default) ]; then
|
||||||
FIND=$(${SYSTEMCTLBINARY} get-default)
|
FIND=$(${SYSTEMCTLBINARY} get-default)
|
||||||
FIND2=$(${ECHOCMD} ${FIND} | ${EGREPBINARY} "runlevel5|graphical")
|
FIND2=$(${ECHOCMD} ${FIND} | ${EGREPBINARY} "runlevel5|graphical")
|
||||||
if HasData "${FIND2}"; then
|
if HasData "${FIND2}"; then
|
||||||
@ -86,9 +84,6 @@
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
LogText "Result: test skipped, as systemctl binary could not be found"
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
#
|
#
|
||||||
#################################################################################
|
#################################################################################
|
||||||
|
Loading…
x
Reference in New Issue
Block a user