Skip to content

Commit 6c3ea08

Browse files
authored
post_install.sh: Use uaccess tag in udev rules
Do not make device node world-readable, instead give access to desktop user. Also use one "here" document instead of mixing in echo statements. Customary keep "then" on same line as "if".
1 parent 24138cc commit 6c3ea08

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

post_install.sh

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
#!/usr/bin/env bash
22

33
arduino_mbed_rules () {
4-
echo ""
5-
echo "# Arduino Mbed bootloader mode udev rules"
6-
echo ""
74
cat <<EOF
8-
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", MODE:="0666"
9-
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", MODE:="0666"
10-
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", MODE:="0666"
11-
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", MODE:="0666"
5+
6+
# Arduino Mbed bootloader mode udev rules
7+
8+
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2e8a", TAG+="uaccess"
9+
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", TAG+="uaccess"
10+
SUBSYSTEMS=="usb", ATTRS{idVendor}=="1fc9", TAG+="uaccess"
11+
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", TAG+="uaccess"
1212
EOF
1313
}
1414

15-
if [ "$EUID" -ne 0 ]
16-
then echo "Please run as root"
15+
if [ "$EUID" -ne 0 ]; then
16+
echo "Please run as root"
1717
exit
1818
fi
1919

0 commit comments

Comments
 (0)