Skip to content

Instantly share code, notes, and snippets.

@hidsh
Created February 9, 2020 03:24
Show Gist options
  • Save hidsh/6514ef563245d501f7442b4d8c0eaaf7 to your computer and use it in GitHub Desktop.
Save hidsh/6514ef563245d501f7442b4d8c0eaaf7 to your computer and use it in GitHub Desktop.
infinit-loop-check for specified USB device for linux - equivalent to `lsusb | grep KEYWORD`
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Usage: chkusb.sh STRING"
exit
fi
while [ 1 ]; do
ret=`lsusb | grep "$1"`
if [ -z "$ret" ]; then
ret="Not found: $1"
fi
echo `date +"%N "`$ret
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment