Hi all I have a usb device that I want to poll periodically.
the device is listed as:
all I want to know is when its plugged in or not plugged in.Code:lsusb | grep "Tiger Jet Network" Bus 002 Device 004: ID 06e6:c200 Tiger Jet Network, Inc. Internet Phone
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.
That is what I had tried thus far, but it doesnt work.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
can someone point me in the direction of being able to execute code if
lsusb says my device is plugged in?



Adv Reply



Bookmarks