summaryrefslogtreecommitdiff
path: root/ao-bringup
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-12-14 23:10:43 -0800
committerKeith Packard <keithp@keithp.com>2017-12-14 23:10:43 -0800
commitb866b3ca249dce61f8ff16c8d28514d1b80386d7 (patch)
tree9146167d8c6c5056a6cf04b4d649638380f14d4b /ao-bringup
parenta4c9233aa8a2f1b1dca6580d6d6275b48c40f01f (diff)
ao-bringup/test-chaoskey: Make finding most recent device more reliable
Use dmesg -t to strip off the timestamp, which avoids having a variable number of fields for awk to look at. Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'ao-bringup')
-rwxr-xr-xao-bringup/test-chaoskey4
1 files changed, 2 insertions, 2 deletions
diff --git a/ao-bringup/test-chaoskey b/ao-bringup/test-chaoskey
index f64b1f84..26684875 100755
--- a/ao-bringup/test-chaoskey
+++ b/ao-bringup/test-chaoskey
@@ -12,8 +12,8 @@ case "$#" in
serial="--serial $1"
;;
0)
- snum=`sudo dmesg | awk '/usb.*Product:/ { ck = index($0, "ChaosKey"); }
- /usb.*SerialNumber:/ { if (ck) print $5; }' | tail -1`
+ snum=`sudo dmesg -t | awk '/usb.*Product:/ { ck = index($0, "ChaosKey"); }
+ /usb.*SerialNumber:/ { if (ck) print $4; }' | tail -1`
case "$snum" in
"")