Refactor conf sample generator script

Optimized grep calls to not create a grep process per file.
Defined variables to enhance readability.

Change-Id: Ic873f2c3b600a737ce54444dec973720c8813285
Merge "Refactor conf sample generator script"
Merge remote-tracking branch 'm_src_repo/citrix-fixes' into build-temp