Implemented as a command-line script which can make arbitrary in-place updates to such config files.
Assuming that the script is saved as conf-update and the config file as test.cfg, the four changes required by the task description could be performed with the command: