| #!/bin/bash |
| # Copyright 2017 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| #### CATEGORY=Device management |
| ### invoke ssh with the keys from $FUCHSIA_BUILD_DIR/ssh-keys |
| |
| scriptdir="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" |
| source "${scriptdir}"/lib/vars.sh || exit $? |
| fx-config-read |
| |
| # Make sure the ssh config is present and has the expected private key |
| check-ssh-config |
| |
| # Export a variable to detect if we've called ourselves. |
| if [[ ${_FX_SSH_ACTIVE-0} -eq 0 ]]; then |
| export _FX_SSH_ACTIVE=1 |
| else |
| echo "[tools/devshell/ssh] Remove ${scriptdir} from your PATH." 1>&2 |
| exit 127 |
| fi |
| |
| # Note: I know there are people who don't like the host-key message, but DO NOT |
| # apply -q here, it silences error messages and makes network and configuration |
| # failures much harder to diagnose when helping people. The control master will |
| # mean you only get one per TCP socket, which is once per newly booted host. |
| # It's not a huge burden compared to end user support. |
| exec ssh -F "${FUCHSIA_BUILD_DIR}/ssh-keys/ssh_config" "$@" |