0
votes
2answers
238 views

Check If a script is executed as root?

I have a script that requires root privileges. I have to execute it either via sudo or from an account with uid 0 (e.g. root). If the script is not executed with sufficient rights then I want that ...
5
votes
3answers
2k views

Automatically execute bash script under the privileges of another user

Is there a way to execute a bash script under the privileges of another user (automatically)? I think "sudo" is the right way, but I don't know how to automate the process. E.g. I want to run ...
2
votes
1answer
93 views

Open application with lowered privileges

I have a mac installer which runs as root with pre and post install bash scripts. At the end of the post install script I launch the application which inherits and opens as root. Is there a way I can ...