refactor: Revise check-for-changes.sh (#2615)

- Inline docs for `check-for-changes.sh` have been shuffled around and revised a bit.
- Change processing extracted from the main change detection loop method to their own methods:
   - `_get_changed_files()` - Clarifies what is going on (and how) without having to look it up. To reduce noise in the main logic loop, extracted to a separate method.
   - `_postfix_dovecot_changes()` - The bulk of change processing was moved to this method. I've added conditionals to only run relevant logic.
   - `_ssl_changes()` - Just shifted, no logic changed. `REGEX_NEVER_MATCH` and `ACME_CERT_DIR` vars scope set to `local`.
This commit is contained in:
Brennan Kinney 2022-06-12 11:36:37 +12:00 committed by GitHub
parent e3cc627e18
commit 851ec8cbcd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 122 additions and 72 deletions

View file

@ -9,7 +9,6 @@
function _handle_postfix_virtual_config
{
: >/etc/postfix/virtual
: >/etc/postfix/regexp
local DATABASE_VIRTUAL=/tmp/docker-mailserver/postfix-virtual.cf
@ -29,6 +28,8 @@ function _handle_postfix_virtual_config
function _handle_postfix_regexp_config
{
: >/etc/postfix/regexp
if [[ -f /tmp/docker-mailserver/postfix-regexp.cf ]]
then
_log 'trace' "Adding regexp alias file postfix-regexp.cf"