2 # part of usb_modeswitch 1.1.7
5 if [ ! -e /var
/lib
/usb_modeswitch
/$1 ]; then
10 if [ $
(expr "$line" : "$2:$3") != 0 ]; then
13 done </var
/lib
/usb_modeswitch
/$1
14 if [ $
(expr "$line" : "$2:$3") != 0 ]; then
28 v_id
=$
(printf %04x $
(($v_id)) )
30 p_id
=$
(printf %04x $
(($p_id)) )
37 dir
=$
(ls -d /sys
$2/ttyUSB
* 2>/dev
/null
)
38 if [ ! -z "$dir" ]; then
42 device_in
"bind_list" $v_id $p_id
43 if [ "$?" = "1" ]; then
44 id_attr
="/sys/bus/usb-serial/drivers/option1/new_id"
45 if [ ! -e "$id_attr" ]; then
46 /sbin
/modprobe option
2>/dev
/null || true
48 if [ -e "$id_attr" ]; then
49 echo "$v_id $p_id" > $id_attr
51 /sbin
/modprobe
-r usbserial
52 /sbin
/modprobe usbserial vendor
=0x
$v_id product
=0x
$p_id
59 device_in
"link_list" $v_id $p_id
60 if [ "$?" = "1" ]; then
61 if [ -e "/usr/bin/tclsh" ]; then
62 exec /usr
/bin
/tclsh
/usr
/sbin
/usb_modeswitch_dispatcher
$1 $2 $v_id $p_id 2>/dev
/null
70 while [ $count != 0 ]; do
71 if [ ! -e "/usr/bin/tclsh" ]; then
75 exec /usr
/bin
/tclsh
/usr
/sbin
/usb_modeswitch_dispatcher
"$@" 2>/dev
/null
&