src.nth.io/

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Hoersten <[email protected]>2026-07-17 20:10:49 -0500
committerLuke Hoersten <[email protected]>2026-07-17 20:10:49 -0500
commiteb7535332975e3b5b3db6823970aea839e34a7e6 (patch)
treeef61409e39380274803f72f9bdd8f9b9c92650dd
parent49c51b4e909053dc71350f4abe215acd29a714c6 (diff)
tools: ota.sh — a `}` inside a ${1:?...} message truncates the expansion; use a usage() fn
-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