-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enhance mail script flexibility, readability, and data management (#64)
* Refactor mismatch storage from single array to associative array This commit refactors the way mismatches are stored in the script. Previously, mismatches were stored in a single array with each element being a string containing the filename, expected size, and actual size. This led to complications when trying to extract individual components from each mismatch. The script now uses an associative array to store mismatches, with the filename as the key and a string containing the expected and actual sizes as the value. This makes it easier to manage and access the data related to each mismatch. * Code cleanup: formatting and unused variables removal * Change requirements to 4.x as associative arrays are in use * Update patch to 3 * Refactor: Use post-increment operator for variable increment Replaced the traditional method of incrementing variables (var=$((var+1))) with the post-increment operator (var++) in the script. This change simplifies the code and takes advantage of the features available in Bash 4.x. * Dynamically retrieve mailnames directory from configuration Replaced hardcoded mailnames directory path with a dynamic retrieval from the /etc/psa/psa.conf configuration file. This allows for greater flexibility and configurability in the script. * Clarify size variable naming for accuracy and consistency Renamed variables and related elements from expected_size to current_size to more accurately reflect the actual size represented in file names.
- Loading branch information
Showing
2 changed files
with
29 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters