I was trying to setup an auto-update (for multiple servers) bash script via cron to a config file (text based) by downloading the new file everyday and replacing it directly. The script works fine, however there's a case where sometimes each server would need to have specific settings being different from the main config file, for example, one of the standard config line would be:
meanwhile some servers would need:
I can manually change that config line on the corresponding server, however it would get overwritten again everytime the auto-update script being run.
So the question, can I make a single bash script to download the reference config file, and then compare it first with the local config file (on the corresponding server) for any differences and then merge it?
By "merge" I mean combining the line properly into:
rather than two separate lines: