src.nth.io/

summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ota.sh9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/ota.sh b/tools/ota.sh
index f03bcc3..0279ab4 100755
--- a/tools/ota.sh
+++ b/tools/ota.sh
@@ -11,8 +11,10 @@
# tools/ota.sh verify <host> # post-push verification only
set -euo pipefail
-cmd="${1:?usage: tools/ota.sh {push|verify} <host> [bin]}"
-host="${2:?usage: tools/ota.sh {push|verify} <host> [bin]}"
+usage() { echo "usage: tools/ota.sh {push|verify} <host> [bin]" >&2; exit 2; }
+[ $# -ge 2 ] || usage
+cmd="$1"
+host="$2"
bin="${3:-build/scrypted-viewport.bin}"
state_line() {
@@ -68,7 +70,6 @@ case "$cmd" in
verify
;;
*)
- echo "usage: tools/ota.sh {push|verify} <host> [bin]" >&2
- exit 2
+ usage
;;
esac