mirror of https://github.com/CISOfy/lynis.git
Rename Maid to CleanUp
This commit is contained in:
parent
b5b8861368
commit
fbd24b585a
|
@ -28,9 +28,10 @@
|
||||||
# AddSystemGroup Adds a system to a group
|
# AddSystemGroup Adds a system to a group
|
||||||
# CheckFilePermissions Check file permissions
|
# CheckFilePermissions Check file permissions
|
||||||
# CheckUpdates Determine if a new version of Lynis is available
|
# 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
|
# CountTests Count number of performed tests
|
||||||
# ContainsString Find the needle (string) in the haystack (another string)
|
# 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)
|
# Debug Display additional information on the screen (not suited for cronjob)
|
||||||
# DigitsOnly Return only the digits from a string
|
# DigitsOnly Return only the digits from a string
|
||||||
# DirectoryExists Check if a directory exists on the disk
|
# DirectoryExists Check if a directory exists on the disk
|
||||||
|
@ -43,12 +44,12 @@
|
||||||
# FileIsEmpty Check if a file is empty
|
# FileIsEmpty Check if a file is empty
|
||||||
# FileIsReadable Check if a file is readable or directory accessible
|
# FileIsReadable Check if a file is readable or directory accessible
|
||||||
# GetHostID Retrieve an unique ID for this host
|
# 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
|
# IsDebug Check if --debug is used
|
||||||
# IsDeveloperMode Check if --developer is used
|
# IsDeveloperMode Check if --developer is used
|
||||||
# IsDeveloperVersion Check if program is a developer release
|
# IsDeveloperVersion Check if program is a developer release
|
||||||
# IsRunning Check if a process is running
|
# 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
|
# IsOwnedByRoot Determine if file or directory is owned by root
|
||||||
# IsVerbose Check if --verbose is used
|
# IsVerbose Check if --verbose is used
|
||||||
# IsVirtualMachine Check if this system is a virtual machine
|
# IsVirtualMachine Check if this system is a virtual machine
|
||||||
|
@ -57,7 +58,6 @@
|
||||||
# IsWorldWritable Check if a file is world writable
|
# IsWorldWritable Check if a file is world writable
|
||||||
# LogText Log text strings to logfile, prefixed with date/time
|
# LogText Log text strings to logfile, prefixed with date/time
|
||||||
# LogTextBreak Insert a separator in log file
|
# LogTextBreak Insert a separator in log file
|
||||||
# Maid
|
|
||||||
# ParseNginx Parse nginx configuration lines
|
# ParseNginx Parse nginx configuration lines
|
||||||
# ParseTestValues Parse a set of values
|
# ParseTestValues Parse a set of values
|
||||||
# PortIsListening Check if machine is listening on specified protocol and port
|
# PortIsListening Check if machine is listening on specified protocol and port
|
||||||
|
@ -226,6 +226,21 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
################################################################################
|
||||||
|
# Name : CleanUp()
|
||||||
|
# Description : Cleanup service
|
||||||
|
# Returns : <nothing>
|
||||||
|
################################################################################
|
||||||
|
|
||||||
|
CleanUp() {
|
||||||
|
echo ""; echo "Interrupt detected."
|
||||||
|
RemovePIDFile
|
||||||
|
RemoveTempFiles
|
||||||
|
Display --text "Cleaning up..." --result DONE --color GREEN
|
||||||
|
ExitFatal
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Name : ContainsString()
|
# Name : ContainsString()
|
||||||
# Description : Search a specific string (or regular expression) in another
|
# Description : Search a specific string (or regular expression) in another
|
||||||
|
@ -1302,21 +1317,6 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# Name : Maid()
|
|
||||||
# Description : Cleanup service
|
|
||||||
# Returns : <nothing>
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
Maid() {
|
|
||||||
echo ""; echo "Interrupt detected."
|
|
||||||
RemovePIDFile
|
|
||||||
RemoveTempFiles
|
|
||||||
Display --text "Cleaning up..." --result DONE --color GREEN
|
|
||||||
ExitFatal
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
# Name : ParseTestValues()
|
# Name : ParseTestValues()
|
||||||
# Description : Parse nginx configuration lines
|
# Description : Parse nginx configuration lines
|
||||||
|
|
2
lynis
2
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
|
# Use safe umask for the files we create
|
||||||
umask 027
|
umask 027
|
||||||
|
|
Loading…
Reference in New Issue