blob: 55095b3ef0e9ea2fd8f165d7c5ba5077019a3758 [file] [log] [blame]
#!/bin/bash
# Copyright 2018 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
### wait for a shell to become available
## usage: fx wait
##
## Attempts to SSH to the target repeatedly until the target becomes
## available.
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $?
device_addr=""
until [[ -n "${device_addr}" ]]; do
device_addr="$(get-fuchsia-device-addr 2>/dev/null)"
done
until fx-command-run ssh "${device_addr}" exit 2>/dev/null; do
echo -n
done