A good way to keep power_off usb bluetooth

Hello!
I searching for a way to disable bluetooth when i don't need it. i can power off bluetooth with usbconfig, but after reboot or suspend/resume bluetooth (or any usb things) turning on, so I added a line to devd.conf to power off after resume:
Code:
usbconfig -d ugen0.3 power_off
normally my bluetooth device is ugen0.3, but sometimes when i use another usb device this will changed and my devd solution will be wrong.
Anyone knows a way to set a default power state for usb units?
 
so I added a line to devd.conf
How and where exactly? Inside a match ... block? There are a number of variables you can use inside the action.

Code:
   Variables that can be used with the match statement
     A partial list of variables and their possible values that can be used
     together with the match statement.  The variables are published by the
     bus based on characteristics of the device that generated the event (for
     device events).  Variables for other classes of events are dependent on
     those events.
See devd.conf(5)

Code:
     port          Hub port number (USB).
Not entirely sure but this might be the one you need.
 
I added another action line to Resume:
Code:
notify 10 {
        match "system"          "ACPI";
        match "subsystem"       "Resume";
        action "/etc/rc.resume acpi $notify";
        action "usbconfig -d ugen0.3 power_off";
};
Which event is better for this? (in current config a need a usb info in acpi block)
I'm not sure devd is proper for this.
 
I have a questions, from where can you get the values for "system", "subsystem" and "type" ? I am trying to do something similar, but when the internet is off, like pppoe0 down, but it is not working...
 
Back
Top