One more thing, would probably be better to use double brackets as it's more modern and I think you can then drop the `-n`, but you have to test to make sure as I'm not certain:

```
if [[ "$SSH_CLIENT" ]] || [[ "$SSH_TTY" ]]; then
```