I'd also create a slimmed down script containing only the necessary components for remote login. First detect the remote login, e.g. via IP address check, then branch into the sub-scripts.
_________________________
There are two types of vessels, submarines and targets.