[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-hotplug
Subject:    Re: Executing user script
From:       Gioele Barabucci <dev () gioelebarabucci ! com>
Date:       2001-03-27 18:58:01
[Download RAW message or body]

On Tuesday 27 March 2001 00:56, Michael Wright wrote:
> I have a script that I want to call everytime that hotplug gets
> activated. (i.e. I want to notify my application everytime a USB device
> is added or removed) Is there a way to do this without hard coding
> my script name in one of the hotplug scripts?
>

It does not seem difficult...

1st we can create a /etc/hotplug/usb.ext_scripts (containing the names of 
programs we have to call) an then execute it line by line from usb.agent.

We can also use something like this

$SCRIPT plugged
$SCRIPT nodriver
$SCRIPT unplugged
$SCRIPT ok

so $1 in your script is the exit status of the various operation done by 
hotplug script.

Btw I think the devfs approach is better...

-- 
Gioele Barabucci (Gb]) 
) mailto:dev@gioelebarabucci.com
) http://www.gioelebarabucci.com
) ) I've been and now I've gone
) )          /Magic Pie^Oasis


_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic