Skip to content

Commit

Permalink
Merge pull request #356 from per1234/post_install-macos-handling
Browse files Browse the repository at this point in the history
Configure post-install script to only operate when platform installed on Linux machine
  • Loading branch information
facchinm authored Jul 30, 2024
2 parents 0af3cba + bf7f1de commit a430d9f
Showing 1 changed file with 24 additions and 18 deletions.
42 changes: 24 additions & 18 deletions post_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,31 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="2341", MODE:="0666"
EOF
}

if [ "$EUID" -ne 0 ]; then
if [ -e "${PWD}/post_install.sh" ]; then
echo
echo "You might need to configure permissions for uploading."
echo "To do so, run the following command from the terminal:"
echo "sudo \"${PWD}/post_install.sh\""
echo
else
# Script was executed from another path. It is assumed this will only occur when user is executing script directly.
# So it is not necessary to provide the command line.
echo "Please run as root"
OS="$(uname -s)"
case "$OS" in
Linux*)
if [ "$EUID" -ne 0 ]; then
if [ -e "${PWD}/post_install.sh" ]; then
echo
echo "You might need to configure permissions for uploading."
echo "To do so, run the following command from the terminal:"
echo "sudo \"${PWD}/post_install.sh\""
echo
else
# Script was executed from another path. It is assumed this will only occur when user is executing script directly.
# So it is not necessary to provide the command line.
echo "Please run as root"
fi

exit
fi

exit
fi
arduino_renesas_core_rules > /etc/udev/rules.d/60-arduino-renesas.rules

arduino_renesas_core_rules > /etc/udev/rules.d/60-arduino-renesas.rules
# reload udev rules
echo "Reload rules..."
udevadm trigger
udevadm control --reload-rules

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

0 comments on commit a430d9f

Please sign in to comment.