parse_ssh_client reads the SSH_CLIENT environment variable, retrieving the IP from which you are currently sshing.
parse_ssh_client
SSH_CLIENT