Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CISOfy/lynis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Ginsbach <brian.ginsbach@gmail.com>2020-04-14 18:49:40 +0300
committerBrian Ginsbach <brian.ginsbach@gmail.com>2021-01-01 06:02:04 +0300
commit89403f1494ded841c5e0ddbf2af028cb50b37f28 (patch)
treedfe6077b86d792bb8f6868e63929640847e892f2 /include/functions
parent8053165d2fcd3bb94ae3e0a8b7eff85b27dd9982 (diff)
Multiple platform support in Register
Support specifying multiple platforms with `--platform`. Useful as not all operating systems identify identical hardware (platforms) with the same name (example x86_64 and amd64).
Diffstat (limited to 'include/functions')
-rw-r--r--include/functions10
1 files changed, 9 insertions, 1 deletions
diff --git a/include/functions b/include/functions
index c88674ba..2bb82eae 100644
--- a/include/functions
+++ b/include/functions
@@ -2670,7 +2670,15 @@
fi
# Check for correct hardware platform
- if [ ${SKIPTEST} -eq 0 -a -n "${TEST_NEED_PLATFORM}" -a ! "${HARDWARE}" = "${TEST_NEED_PLATFORM}" ]; then SKIPTEST=1; SKIPREASON="Incorrect hardware platform"; fi
+ if [ ${SKIPTEST} -eq 0 -a -n "${TEST_NEED_PLATFORM}" ]; then
+ HASMATCH=0
+ for I in ${TEST_NEED_PLATFORM}; do
+ if [ "${I}" = "${HARDWARE}" ]; then HASMATCH=1; fi
+ done
+ if [ ${HASMATCH} -eq 0 ]; then
+ SKIPTEST=1; SKIPREASON="Incorrect hardware platform (${TEST_NEED_PLATFORM} only)"
+ fi
+ fi
# Check for required (and discovered) package manager
if [ ${SKIPTEST} -eq 0 -a ${TEST_NEED_PKG_MGR} -eq 1 -a ${HAS_PACKAGE_MANAGER} -eq 0 ]; then SKIPTEST=1; SKIPREASON="Requires a known package manager to test presence of a particular package"; fi