Does anyone know of a way to detect that a shell script is running within ARD (vs. running the same script locally on the machine)?
I looked at detecting that we are running in interactive mode - that fails, since both are noninteractive.
I'm looking at the $0 variable, which looks more promising - it returns -bash
when run from the command line, returns the name of the script when running within a script run locally, and returns /bin/bash
when run via ARD. However - I'm not certain whether those effects can be counted on.
Does anyone have any input on this?