mirror of https://github.com/CISOfy/lynis.git
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
|
||||
Register --test-no KRNL-5622 --os Linux --weight L --network NO --category security --description "Determine Linux default run level"
|
||||
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
|
||||
LogText "Test: Checking for systemd default.target"
|
||||
if [ $(${SYSTEMCTLBINARY} get-default) ]; then
|
||||
if [ $( [ ! -z ${SYSTEMCTLBINARY} ] && ${SYSTEMCTLBINARY} get-default) ]; then
|
||||
FIND=$(${SYSTEMCTLBINARY} get-default)
|
||||
FIND2=$(${ECHOCMD} ${FIND} | ${EGREPBINARY} "runlevel5|graphical")
|
||||
if HasData "${FIND2}"; then
|
||||
|
@ -86,9 +84,6 @@
|
|||
fi
|
||||
fi
|
||||
fi
|
||||
else
|
||||
LogText "Result: test skipped, as systemctl binary could not be found"
|
||||
fi
|
||||
fi
|
||||
#
|
||||
#################################################################################
|
||||
|
|
Loading…
Reference in New Issue