1
Development and Code Review / Need Advice: Managing Configuration Files
« on: May 11, 2024, 04:35:58 pm »
Hello everyone! I've encountered an issue while developing a plugin and need your help. My task is as follows: I have a service that utilizes multiple configuration files, named in the format e2guardianfN.conf, where N is a sequential number starting from one. In my model, I've added an 'instance' field where the file number is inputted. However, the service is sensitive to the order of these files, and it's not possible to simply delete a random file without restoring the naming order. My idea is to modify entries with an 'instance' number greater than the one being deleted. But how can I do this in the most appropriate way? I'd appreciate any tips and advice!
Also, I've uploaded a draft of the code to GitHub. Here is the link: https://github.com/Gunior80/E2G-OPNsense
Also, I've uploaded a draft of the code to GitHub. Here is the link: https://github.com/Gunior80/E2G-OPNsense