Add IsDebug and IsVerbose functions

This commit is contained in:
mboelen 2016-04-19 19:44:23 +02:00
parent d54f3ae307
commit 64561d4b07
1 changed files with 26 additions and 0 deletions

View File

@ -43,9 +43,11 @@
# FileIsEmpty Check if a file is empty
# FileIsReadable Check if a file is readable or directory accessible
# GetHostID Retrieve an unique ID for this host
# IsDebug Check if --debug is used
# IsRunning Check if a process is running
# InsertSection Insert a section block
# InsertPluginSection Insert a section block for plugins
# IsVerbose Check if --verbose is used
# IsVirtualMachine Check if this system is a virtual machine
# IsWorldExecutable Check if a file is world executable
# IsWorldReadable Check if a file is world readable
@ -879,6 +881,18 @@
LogText "Action: Performing plugin tests"
}
################################################################################
# Name : IsDebug
# Description : Check if --debug option is used to show more details
# Returns : 0 (true) or 1 (false)
################################################################################
IsDebug() {
if [ ${DEBUG} -eq 1 ]; then return 0; else return 1; fi
}
################################################################################
# Name : IsRunning()
# Description : Check if a process is running
@ -902,6 +916,18 @@
fi
}
################################################################################
# Name : IsVerbose
# Description : Check if --verbose option is used to show more details on screen
# Returns : 0 (true) or 1 (false)
################################################################################
IsVerbose() {
if [ ${VERBOSE} -eq 1 ]; then return 0; else return 1; fi
}
################################################################################
# Name : IsVirtualMachine()
# Description : Check if a specific item exists in the report