matthieu castet wrote:

matthieu castet wrote:



-LAST_CHARS="${DEVPATH:`expr ${#DEVPATH} - 3`}"
-if [ -z "$LAST_CHARS" ] || [ "x$LAST_CHARS" = "x1.0" ] ; then
+LAST_CHARS="${DEVPATH#*[0-9]*\-[0-9]*}"
bon ça buge : ça marche pas pour DEVPATH=bus/usb/devices/21-1111:1.0 :(
si quelq'un voit un moyen de le faire simplement ...
ça marchais pas avant car lors du demarage a froid le script est appeler avec DEVPATH=bus/usb/devices/xxx-yyyy

Matthieu

ce patch devrait mieux marcher

Matthieu

--- eu_dsp.old	2004-03-20 15:28:59.000000000 +0100
+++ /etc/hotplug/usb/eu_dsp	2004-03-20 16:02:33.000000000 +0100
@@ -1,4 +1,4 @@
-#!/bin/bash
+#! /bin/bash
 # $Id: eu_dsp,v 1.4 2004/02/21 01:25:02 Tux Exp $
 # Name: eu_dsp
 # Goal: This script handles the ADI ADSL Modem USB driver after firmware
@@ -8,27 +8,27 @@
 #       It should only be run by hotplug.
 # Author: Tux
 # Params (given by hotplug):
-#	$DEVICE (ex: /proc/bus/usb/002/005)
+#	$REMOVER (ex: /var/run/usb/%proc%bus%usb%002%005)
+#	$DEVPATH (ex: bus/usb/devices/2-1:1.0)
 
 . /etc/eagle-usb/scripts/setvars
 
 # this script can only be called by hotplug (giving the $DEVICE param)
-if [ -z $DEVICE ] ; then
+if [ -z $REMOVER ] ; then
 	echo -e "$NO_PARAM_MSG"
 	exit
 fi
 
-LAST_CHARS="${DEVPATH:`expr ${#DEVPATH} - 3`}"
-if [ -z "$LAST_CHARS" ] || [ "x$LAST_CHARS" = "x1.0" ] ; then
+LAST_CHARS="${DEVPATH#*:}"
+if [ -z "$LAST_CHARS" ] || [ "x$LAST_CHARS" = "x1.0" ] \
+	                || [ "x$LAST_CHARS" = "x$DEVPATH" ] ; then
 	# script called when the modem will be unplugged
 	mkdir -p /var/run/usb
-	UNPLUGSCRIPT="/var/run/usb/`echo $DEVICE | sed 's/\//%/g'`"
-	echo "#!/bin/bash" > $UNPLUGSCRIPT
-	echo "${SBIN_DIR}/fctStopAdsl" >> $UNPLUGSCRIPT
-	echo "rmmod eagle-usb" >> $UNPLUGSCRIPT
-	echo "rm -f ${UNPLUGSCRIPT}" >> $UNPLUGSCRIPT
-	chmod u+x $UNPLUGSCRIPT
+	echo "#!/bin/bash" > $REMOVER
+	echo "${SBIN_DIR}/fctStopAdsl" >> $REMOVER
+	echo "rmmod eagle-usb" >> $REMOVER
+	chmod u+x $REMOVER
 	
 	# load DSP & options
-	eaglectrl -d 0>&1 1>&1 2>&1 | logger
+	eaglectrl -d 2>&1 | logger
 fi

Reply via email to