Skip to content
Snippets Groups Projects
Commit 8bfe040f authored by Bryan Henry's avatar Bryan Henry Committed by CQ bot account: commit-bot@chromium.org
Browse files

[fx] Add get-device and get-device-addr commands

Useful both for scripts and for interactive use (like in fx scp or
sftp).

Change-Id: I8bd3dc398b8fb0547dda44b3e8ca9ee4e3b923ec
parent 824e64c8
No related branches found
No related tags found
No related merge requests found
#!/bin/bash
# Copyright 2019 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.
### print the current selected device name
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $?
get-device-name
#!/bin/bash
# Copyright 2019 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.
### print the Fuchsia IPv6 address of the current selected device
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $?
fx-config-read
get-fuchsia-device-addr
......@@ -12,7 +12,7 @@
##
## Example usage:
##
## fx scp "[$(fx netaddr --fuchsia)]:source_file" dest_file
## fx scp "[$(fx get-device-addr)]:source_file" dest_file
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $?
fx-config-read
......
......@@ -13,7 +13,7 @@
##
## Example usage:
##
## fx sftp "[$(fx netaddr --fuchsia)]:source_file" dest_file
## fx sftp "[$(fx get-device-addr)]:source_file" dest_file
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"/lib/vars.sh || exit $?
fx-config-read
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment