(1) On fat32 system, there are no executable flags for files, and so "./somefile" (as in line 18) invocation in the script won't work. So in order to execute the bash script from such a filesystem, we need to explicitly run it with bash, and then make it use ld-linux to run executable files that are on the very same filesystem. Instead of testing if ld-linux is actually needed, we can just use it all the time, since if the script is on a proper filesystem with normal permissions, it will work just the same anyway.
(2) The script now reports what it is going to do first, and then waits for confirmation. So if something isn't right, the user can always cancel the procedure.
(3) The script prints a warning and exits if it's not run with super-user privileges, since it won't be able to install anything anyway.
(1) On fat32 system, there are no executable flags for files, and so "./somefile" (as in line 18) invocation in the script won't work. So in order to execute the bash script from such a filesystem, we need to explicitly run it with bash, and then make it use ld-linux to run executable files that are on the very same filesystem. Instead of testing if ld-linux is actually needed, we can just use it all the time, since if the script is on a proper filesystem with normal permissions, it will work just the same anyway.
(2) The script now reports what it is going to do first, and then waits for confirmation. So if something isn't right, the user can always cancel the procedure.
(3) The script prints a warning and exits if it's not run with super-user privileges, since it won't be able to install anything anyway.