Skip to content
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

Added Linux post install script #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
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
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_esp32_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_esp32_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.