|
#1
|
|||
|
|||
SD scripting with admin passwords
I'm trying to use SuperDuper to backup our OS X Server. To be safe, I want to stop down all server services running in Server Admin before I do the backup, and restart them after the backup.
I know SuperDuper can do shell scripts, but I only know how to stop services using Applescript (tho the Applescript does trigger shell scripts). How would I write the following applescript purely in shell script style: Code:
do shell script "serveradmin stop afp" password "ourpassword" with administrator privileges delay 10 do shell script "serveradmin stop mail" password "ourpassword" with administrator privileges delay 10 do shell script "serveradmin stop print" password "ourpassword" with administrator privileges delay 10 do shell script "serveradmin stop web" password "ourpassword" with administrator privileges delay 10 |
#2
|
|||
|
|||
After a bit of reading, I gather that you can call an Applescript from a shell script, using osascript.
However, this seems a rather roundabout way of doing things, since what I would be doing is running a shell script which runs an applescript ... which runs a shell script.. Any way to do it completely in a shell script? Last edited by marcusororleeus; 07-24-2006 at 02:22 PM. |
#3
|
||||
|
||||
Well, the thing is you are doing it in a shell script, because the commands you're running are shell script commands, being executed by AppleScript.
Just put: #!/bin/sh serveradmin stop afp serveradmin stop mail serveradmin stop print serveradmin stop web in your shell script. The script will be run authenticated, and you should be good to go. In your "after" script, use: serveradmin start afp (etc) Hope that helps!
__________________
--Dave Nanian |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
User Acc. Passwords On Clone changed? | slickmrick | General | 2 | 06-27-2006 05:55 PM |
Sandbox won't recognize previous users & passwords | tdsg | General | 1 | 01-08-2006 07:05 PM |
Scripting and the Log | edoates | General | 5 | 07-27-2005 06:39 PM |
Shell scripting | rik17 | General | 9 | 07-15-2005 11:08 PM |