|
not sure if you're going from a programming angle with the references to poll() there, but i'd suggest you look toward udev rules, assuming you're using udev of course. in a specific rule you can set a PROGRAM= variable to run a script on a device being connected. not sure about disconnection, as i've never done it, but i expect it's simple.
|