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: Steve Hayman <email@hidden>
- Date: Wed, 24 Oct 2007 23:02:03 -0400
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
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.
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.
_______________________________________________
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