From fbd24b585adb8cc71243785e40fefafb38eaa14e Mon Sep 17 00:00:00 2001 From: Michael Boelen Date: Tue, 5 Jul 2016 12:16:49 +0200 Subject: [PATCH] Rename Maid to CleanUp --- include/functions | 38 +++++++++++++++++++------------------- lynis | 2 +- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/include/functions b/include/functions index abbd62af..8a8fe00d 100644 --- a/include/functions +++ b/include/functions @@ -28,9 +28,10 @@ # AddSystemGroup Adds a system to a group # CheckFilePermissions Check file permissions # CheckUpdates Determine if a new version of Lynis is available -# CreateTempFile Create a temporary file +# CleanUp Clean up files before closing program # CountTests Count number of performed tests # ContainsString Find the needle (string) in the haystack (another string) +# CreateTempFile Create a temporary file # Debug Display additional information on the screen (not suited for cronjob) # DigitsOnly Return only the digits from a string # DirectoryExists Check if a directory exists on the disk @@ -43,12 +44,12 @@ # 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 +# InsertSection Insert a section block +# InsertPluginSection Insert a section block for plugins # 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 -# InsertSection Insert a section block -# InsertPluginSection Insert a section block for plugins # IsOwnedByRoot Determine if file or directory is owned by root # IsVerbose Check if --verbose is used # IsVirtualMachine Check if this system is a virtual machine @@ -57,7 +58,6 @@ # IsWorldWritable Check if a file is world writable # LogText Log text strings to logfile, prefixed with date/time # LogTextBreak Insert a separator in log file -# Maid # ParseNginx Parse nginx configuration lines # ParseTestValues Parse a set of values # PortIsListening Check if machine is listening on specified protocol and port @@ -226,6 +226,21 @@ } + ################################################################################ + # Name : CleanUp() + # Description : Cleanup service + # Returns : + ################################################################################ + + CleanUp() { + echo ""; echo "Interrupt detected." + RemovePIDFile + RemoveTempFiles + Display --text "Cleaning up..." --result DONE --color GREEN + ExitFatal + } + + ################################################################################ # Name : ContainsString() # Description : Search a specific string (or regular expression) in another @@ -1302,21 +1317,6 @@ } - ################################################################################ - # Name : Maid() - # Description : Cleanup service - # Returns : - ################################################################################ - - Maid() { - echo ""; echo "Interrupt detected." - RemovePIDFile - RemoveTempFiles - Display --text "Cleaning up..." --result DONE --color GREEN - ExitFatal - } - - ################################################################################ # Name : ParseTestValues() # Description : Parse nginx configuration lines diff --git a/lynis b/lynis index b1035b34..3dffa9d1 100755 --- a/lynis +++ b/lynis @@ -194,7 +194,7 @@ Make sure to execute ${PROGRAM_NAME} from untarred directory or check your insta # ################################################################################# # - trap Maid INT + trap CleanUp INT # Use safe umask for the files we create umask 027