blob: 885ba5eb8d882faa7e78a37ab5017b663ffdac4e [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.
### do a system OTA
## usage: fx ota [-d|--device <device_address>] [-h|--help]
##
## Ask the target to do an OTA. The target will use any update server available
## to it to do the update. This requires the target have a update server
## available to it. The 'serve' command is typically used to make your
## development host available to the target as an update server.
##
## Arguments:
## -h|--help Print out this message.
## -d|--device Fuchsia link-local name of the device. If not
## specified, will connect to the only available
## device on the link-local network.
source "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"/lib/vars.sh
fx-config-read
function main {
fx-standard-switches "$@"
set -- "${FX_ARGV[@]}"
fx-command-run shell "$@" amber_ctl system_update
local r=$?
echo "Check the target's log for update progress"
return $r
}
main "$@"