Is there a program/script to modify .conf files?
Augeas is a: A command line tool to manipulate configuration from the shell (and shell scripts). (among other things)
It uses lenses to transform every file to xml, give special tools to edit them, and use the lenses to write the file back in native format.