Created
February 9, 2020 03:24
-
-
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`
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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