Skip to content

Commit

Permalink
Merge pull request #893 from per1234/post-install-message
Browse files Browse the repository at this point in the history
Display useful message when Linux post-install script has insufficient permissions
  • Loading branch information
facchinm authored Jun 10, 2024
2 parents 6293cea + daea2f1 commit 0108ded
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions post_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,19 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", MODE:="0666"
EOF
}

if [ "$EUID" -ne 0 ]
then echo "Please run as root"
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

Expand Down

0 comments on commit 0108ded

Please sign in to comment.