Re: running a shell script in automator with admin privileges
Re: running a shell script in automator with admin privileges
- Subject: Re: running a shell script in automator with admin privileges
- From: Brett George <email@hidden>
- Date: Wed, 24 Oct 2007 20:40:43 -0700
Steve Hayman wrote:
On 24-Oct-07, at 10:54 PM, Brett George wrote:
I have a simple automator workflow that asks for confirmation before
running a shell script. The shell script needs to run as root and
calling the commands with "sudo" doesn't prompt the user to authenticate.
Try using an Applescript action instead, and inside the applescript, doing
do shell script "/path/to/actual/script/here" with administrator
privileges
That oughta do it, provided you can live with having the script stored
outside the workflow itself. Depending how complex the script is,
you may also be able to put the whole script inside a "do shell script",
like this
I can't. I'd like to deliver the file as a single executable. I suppose
I could bury it in the executable package...
do shell script "command 1; commmand 2; entire script here; if foo
then bar; end if; etc etc etc" with administrator privileges
which works too.
Right, but I was hoping there was another way to do what I want.
Prior to running the shell script, I have also tried running a simple
apple script with
do shell script "echo test" with administrator privileges
but the commands are still not authenticated properly.
Well - the "echo test" would have run as root, but nothing else. "with
adminstrator privleges" only affects that specific command you're
running via "do shell script" - it doesn't authenticate the whole
workflow or anything.
Thanks,
Brett.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Automator-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden