From 64561d4b071738a7423dea96c1cba09c223ef6cc Mon Sep 17 00:00:00 2001 From: mboelen Date: Tue, 19 Apr 2016 19:44:23 +0200 Subject: [PATCH] Add IsDebug and IsVerbose functions --- include/functions | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/include/functions b/include/functions index 1575e57a..731aef5f 100644 --- a/include/functions +++ b/include/functions @@ -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