Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhance script flexibility, readability, and data management #64

Merged
merged 7 commits into from
Apr 12, 2024

Conversation

obendev
Copy link
Contributor

@obendev obendev commented Apr 11, 2024

  • Dynamic configuration: Retrieve mailnames directory from configuration file for adaptability (commit 4de6093).
  • Code modernization: Employ post-increment operator for cleaner variable increment (commit 3c7b9ec).
  • Code hygiene: Improve readability through formatting and eliminate unused variables (commit b7155ca).
  • Data structure optimization: Refactor mismatch storage to an associative array for easier access and management (commit 85d49c3).

obendev added 7 commits April 11, 2024 08:39
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.
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.
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.
Renamed variables and related elements from expected_size to current_size to more accurately reflect the actual size represented in file names.
@sibprogrammer sibprogrammer self-requested a review April 12, 2024 15:45
@sibprogrammer sibprogrammer merged commit 2f73ed2 into plesk:master Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants