Skip to content

Added Linux post install script #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added a simple post install script for Linux environment to fix the U…
…DEV rules
  • Loading branch information
StarDev-it committed Aug 5, 2023
commit a0da2148772aef3e9919c39b04b0fcae4bf92fc2
22 changes: 22 additions & 0 deletions post_install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

arduino_mbed_rules () {
echo ""
echo "# Arduino ESP32 bootloader mode udev rules"
echo ""

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a particularly weird mixture of echo and "here" documents. Simply use one "here" document.

cat <<EOF
SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", ATTRS{idProduct}=="0070", MODE:="0666"
EOF
}

if [ "$EUID" -ne 0 ]
then echo "Please run as root"
exit
fi

arduino_mbed_rules > /etc/udev/rules.d/60-arduino-esp32.rules

# reload udev rules
echo "Reload rules..."
udevadm trigger
udevadm control --reload-rules

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing EOL on last line. Using a proper text editor avoids this. Unix text files should have a line terminator on every line, including the last line.