Add notebook hardware detection

This commit is contained in:
Michael Boelen 2016-08-13 16:38:07 +02:00
parent 67a636f351
commit e06db1477d
3 changed files with 23 additions and 2 deletions

View File

@ -198,6 +198,7 @@ unset LANG
SSL_CERTIFICATE_PATHS=""
SYSLOGNGBINARY=""
SYSTEMCTLBINARY=""
SYSTEM_IS_NOTEBOOK=255
TEMP_FILE=""
TEMP_FILES=""
TEST_SKIP_ALWAYS=""

View File

@ -53,8 +53,9 @@
# IsDebug Check if --debug is used
# IsDeveloperMode Check if --developer is used
# IsDeveloperVersion Check if program is a developer release
# IsRunning Check if a process is running
# IsNotebook System detection
# IsOwnedByRoot Determine if file or directory is owned by root
# IsRunning Check if a process is running
# IsVerbose Check if --verbose is used
# IsVirtualMachine Check if this system is a virtual machine
# IsWorldExecutable Check if a file is world executable
@ -1117,6 +1118,24 @@
}
################################################################################
# Name : IsNotebook
# Description : Check if file or directory is owned by root
# Returns : 0 (true), 1 (false), or 255 (unknown)
################################################################################
IsNotebook() {
FIND=$(which laptop-detect 2> /dev/null)
if [ ! -z "${FIND}" ]; then
Debug "Testing if we are a notebook"
laptop-detect
if [ $? -eq 0 ]; then SYSTEM_IS_NOTEBOOK=1; Debug "System is a notebook according to laptop-detect"
elif [ $? -eq 1 ]; then SYSTEM_IS_NOTEBOOK=0; Debug "System is a NOT a notebook according to laptop-detect"; fi
Report "notebook=${SYSTEM_IS_NOTEBOOK}"
fi
}
################################################################################
# Name : IsOwnedByRoot
# Description : Check if file or directory is owned by root

3
lynis
View File

@ -747,8 +747,9 @@ ${NORMAL}
#
#################################################################################
#
# Check if this is a virtual machine (after the appropriate binaries are found)
# Use hardware detection capabilities
IsVirtualMachine
IsNotebook
#
#################################################################################
#