Commit fa500ebca438f896ba40791ab7245479aa8d237b

Authored by grouille
1 parent 9e185e7d

MAJ

site/fichiersRPI/fichiersRPI.zip
No preview for this file type
site/fichiersRPI/port.sh
1 1 #!/bin/bash
2 2  
  3 +base=`dirname $0`
  4 +cd $base
3 5 data=$(dmesg | grep ttyACM | cut -f 7 -d " " | cut -f 1 -d : )
4 6 code=$(echo $data | cut -f 1 -d " ")
5   -#echo $code
6 7 port=$(pwd | cut -c 17)
7 8 let port--
8   -#echo $port
9 9 dev="/dev/ttyACM"
10 10 name="$dev$port"
11 11 commande=$(udevadm info --name=$name --attribute-walk | egrep "idVendor|idProduct|serial")
12 12 idProduct=$(echo $commande | cut -f 1 -d " ")
13 13 idVendor=$(echo $commande | cut -f 2 -d " ")
14 14 serial=$(echo $commande | cut -f 3 -d " ")
15   -#echo $commande
16   -#echo $idProduct
17   -#echo $idVendor
18   -#echo $serial
19 15 newdev="ttyPR"
20 16 newname="$newdev$port"
21   -#echo $newname
22 17 rule="SUBSYSTEM==\"tty\", $serial, $idVendor, $idProduct, SYMLINK+=\"$newname\""
23   -#echo $rule
24 18 echo $rule >> /etc/udev/rules.d/usb-serial.rules
25 19 udevadm trigger
  20 +
... ...