bash: Fixed /etc/profile.d/* handling

The script was a bit too simple so it failed to manage files in
/etc/profile.d when more than 1 file was present. This is now fixed.