You will need to manually edit /etc/devd.conf
Just create/edit the attach entry for the device it shows up on to do what you would do manually.
I would recommend creating a shell script to do the actual mounting as your code should test for certain things and be prepared for failure.
So, for example, your code would be something like:
Code:
# The entry below starts moused when a mouse is plugged in. Moused
# stops automatically (actually it bombs :) when the device disappears.
attach 100 {
device-name "ums[0-9]+";
action "/etc/rc.d/moused start $device-name";
};
This is the usb mouse code right here. You would replace the part after
action with the shell script command to mount the device.
Note automatic unmounting is another issue. I have never got that working perfectly. You see, the unmount should happen before the device is unplugged... and you won't get the detach signal until you unplug the device -- so you can't use the same method.