Since that whole thing looks like (mostly) a script, could I break it into 3-4 pieces, chmod, and actually just execute those scripts? e.g. I would split it into files where it says "sudo reboot", and ...