crosh: move bash re-exec logic to a func

This moves the bash re-exec code into a func so that it's easier to
follow and see the start/end of things.

BUG=None
TEST=crosh still works on device (and uses bash)
TEST=`/bin/dash crosh --dash` still works (and uses dash)

Change-Id: I3cbbe61549e37f274e045ff591fac1494d392664
Reviewed-on: https://chromium-review.googlesource.com/178933
Reviewed-by: Chris Masone <cmasone@chromium.org>
Commit-Queue: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
1 file changed