[homdir] Quote shell variables where required.

This fixes many warnings for these scripts.
[install] Fixed several checks that were just wrong.