Check that the chroot has a valid shell
Fixed several bashisms
chroot.sh uses sudo on itself properly if not root