after having gained some weeks of experience with Linux, I got the need to have more overview and control over the system configuration, because manually editing files seems to be error-prone, time-consuming and complicated.
Hence, I would like to write a script that completely checks and if necessary corrects the configuration of a whole Linux system. Checking file and folder existence and their privileges isn’t a problem, but how could I screen single files for certain entries? It could also be interesting to extract the contents of all the files of interest and save their content in one single file.
Anyway, I don’t know if my ideas are good, but I am here to ask how you professionals
deal with that problem. Thanks for you answers.
Do a search for “configuration management” (and maybe “devops”) and I think you’ll find lots of interesting material. Many people use tools like Puppet, Chef, and others to create automated, re-deployable environments for their systems.
This is an area for which there are lots of solutions…and a lot of prior work. While writing your own script might be educational, you will probably better served in the long run by becoming familiar with version control and configuration management and adapting these sorts of tools to meet your needs.