#!/bin/sh
#
# hotplug script for USBDUX. Apr 12 GMT 2007
# berndporr@f2s.com
#
#
#
#look for comedi config
COMEDI_CONFIG=
#
if [ -e /usr/local/sbin/comedi_config ]; then
	COMEDI_CONFIG=/usr/local/sbin/comedi_config
fi
if [ -e /usr/sbin/comedi_config ]; then 
        COMEDI_CONFIG=/usr/sbin/comedi_config
fi
if [ -e /sbin/comedi_config ]; then 
        COMEDI_CONFIG=/sbin/comedi_config
fi
#
#
#look for the firmware
USBDUX_FIRMWARE=
if [ -e /usr/share/usb/usbdux_firmware.hex ]; then 
        USBDUX_FIRMWARE=/usr/share/usb/usbdux_firmware.hex
fi
if [ -e /usr/local/share/usb/usbdux_firmware.hex ]; then
        USBDUX_FIRMWARE=/usr/local/share/usb/usbdux_firmware.hex
fi
#
#
# If you have more than one device please add/uncomment
# 
# just to make sure we remove the comedi device
$COMEDI_CONFIG -r /dev/comedi0
#
# connecting the comedi device comedi0 with the module usbdux
$COMEDI_CONFIG -i $USBDUX_FIRMWARE /dev/comedi0 usbdux
#
#
