#!/bin/sh
echo $MDEV#$ACTION >> /tmp/mdev.log
startusbremounttmpfile="/tmp/.startusbremount"

devname="$MDEV"
action="$ACTION"
echo "********************************************************${action}*********************************************************"
if [ -z "$ACTION" ];then
	ACTION=1
elif [ "$ACTION" = "add" ];then 
	ACTION=1
	##########wifi	
	sleep 2
	if [ -d "/sys/devices/platform/"ehci_marvell.*"/usb1/1-1/usb_device/${devname}" ];then
		#/sys/devices/platform/ehci_marvell.70059/usb1/1-1/usb_device/usbdev1.6/device/1-1\:1.0/net/wlan0/
		ls -d /sys/devices/platform/ehci_marvell.*/usb1/1-1/usb_device/${devname}/device/[0-9]*-[0-9]*:[0-9]*.[0-9]*/net/wlan[0-9]* > "$startusbremounttmpfile"
		while read DEVPATH 
		do
			/etc/init.d/nas/wirelessconn
		done < "$startusbremounttmpfile"
	fi
	###############	
else
	ACTION=0 
fi

exit 0	
