• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: running a shell script in automator with admin privileges
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
References: 
 >running a shell script in automator with admin privileges (From: Brett George <email@hidden>)
 >Re: running a shell script in automator with admin privileges (From: Steve Hayman <email@hidden>)

  • Prev by Date: Re: running a shell script in automator with admin privileges
  • Next by Date: Create image slides for Keynote.
  • Previous by thread: Re: running a shell script in automator with admin privileges
  • Next by thread: Create image slides for Keynote.
  • Index(es):
    • Date
    • Thread