Hi all I have a usb device that I want to poll periodically.
the device is listed as:
Code:
lsusb | grep "Tiger Jet Network"
Bus 002 Device 004: ID 06e6:c200 Tiger Jet Network, Inc. Internet Phone
all I want to know is when its plugged in or not plugged in.
how might I do that?
Im just starting to read about polling, lsusb tells me what I want to know, but I dont know how to put it into a true false statement in a bash script.
Code:
#!/bin/bash
result=0
result=`lsusb | grep -e "Tiger Jet Network, Inc. Internet Phone"`
if $result !=0
then
echo "Great execute some code"
else
echo "Device was unpluged"
exit
fi
That is what I had tried thus far, but it doesnt work.
can someone point me in the direction of being able to execute code if
lsusb says my device is plugged in?
Bookmarks