Skip to content

Commit 0108ded

Browse files
authored
Merge pull request #893 from per1234/post-install-message
Display useful message when Linux post-install script has insufficient permissions
2 parents 6293cea + daea2f1 commit 0108ded

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

Diff for: post_install.sh

+13-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,19 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="0525", MODE:="0666"
1212
EOF
1313
}
1414

15-
if [ "$EUID" -ne 0 ]
16-
then echo "Please run as root"
15+
if [ "$EUID" -ne 0 ]; then
16+
if [ -e "${PWD}/post_install.sh" ]; then
17+
echo
18+
echo "You might need to configure permissions for uploading."
19+
echo "To do so, run the following command from the terminal:"
20+
echo "sudo \"${PWD}/post_install.sh\""
21+
echo
22+
else
23+
# Script was executed from another path. It is assumed this will only occur when user is executing script directly.
24+
# So it is not necessary to provide the command line.
25+
echo "Please run as root"
26+
fi
27+
1728
exit
1829
fi
1930

0 commit comments

Comments
 (0)