mirror of
https://github.com/CISOfy/lynis.git
synced 2025-04-08 17:15:25 +02:00
Add notebook hardware detection
This commit is contained in:
parent
67a636f351
commit
e06db1477d
@ -198,6 +198,7 @@ unset LANG
|
||||
SSL_CERTIFICATE_PATHS=""
|
||||
SYSLOGNGBINARY=""
|
||||
SYSTEMCTLBINARY=""
|
||||
SYSTEM_IS_NOTEBOOK=255
|
||||
TEMP_FILE=""
|
||||
TEMP_FILES=""
|
||||
TEST_SKIP_ALWAYS=""
|
||||
|
@ -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
3
lynis
@ -747,8 +747,9 @@ ${NORMAL}
|
||||
#
|
||||
#################################################################################
|
||||
#
|
||||
# Check if this is a virtual machine (after the appropriate binaries are found)
|
||||
# Use hardware detection capabilities
|
||||
IsVirtualMachine
|
||||
IsNotebook
|
||||
#
|
||||
#################################################################################
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user