[KRNL-5622] test if systemctl binary is set

This commit is contained in:
Michael Boelen 2024-09-30 11:53:13 +00:00
parent f155be945f
commit 03168113ca
No known key found for this signature in database
GPG Key ID: 26141F77A09D7F04

View File

@ -39,6 +39,8 @@
# 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
@ -84,6 +86,9 @@
fi
fi
fi
else
LogText "Result: test skipped, as systemctl binary could not be found"
fi
fi
#
#################################################################################