Oh, ahh, hmmm, this function makes me worried because the format and use of these ifcfg-* files changes between versions and distributions.  Anything other than the most simple setup will break this function, for example, what if there are static bridge definitions, bonded interfaces, etc?  It's also read by a totally arcane interpreter (/bin/sh), which is not used in this code.  Short of writing a very complicated parser that can deal with shell and environment variables, format changes these files have seen over time, I think it would be good to avoid them entirely.  I think it's safe to take the data you get from ``ifconfig`` as "the way it is" and don't bother with these files.