I have a large wrapper.sh
file which does a lot of things, but in the end runs catalina.sh
tomcat.
Problem is that users who run this wrapper.sh
are experiencing error: no permissions to execute catalina.sh
. They have to manually set this permission, which is something I do not want.
On my computer, chmod u+x catalina.sh
fixes this, therefore I included it in the wrapper.sh
, right before executing catalina.sh
:
#!/bin/sh
# <...>
# <...>
chmod +x catalina.sh
exec ./catalina.sh
But will this change work for everyone? I can imagine, for example, that it indeed works fine on my computer, but someone else would get some sudo-related error when implicitly running that chmod
. How can I make it work for everyone?