[TASK] Simplify setfilepermissions.sh (Revision 2)

Make the setfilepermissions script a bit more readable

Change-Id: I75459381df4c0701aeed75484990ab3ed63f0d2c
Releases: master
Revision-Id: eab04d680a2534c2a356eebd9765530495d3272e