Scripting a command to unix with sudo fun
Scripting a command to unix with sudo fun
- Subject: Scripting a command to unix with sudo fun
- From: "David B. Peterson" <email@hidden>
- Date: Fri, 15 Mar 2002 11:18:48 -0800
You can pass your password to sudo on stdin:
-S The -S (stdin) option causes sudo to read the password
from standard input instead of the terminal device.
so your script becomes:
tell application "Terminal"
activate
do script with command "echo myrootpasswd | sudo
/System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp/Applications/Utils-Network/RumpusServer/Rumpus2.1Carbon
"
end tell
Of course, you will probably want to do a 'sudo -K' first, to make
sure it asks for a password (because it caches the passwd.)
do script with command "sudo -K && echo myrootpasswd | sudo
/System/Library/Frameworks/Carbon.framework/Versions/A/Support/LaunchCFMApp/Applications/Utils-Network/RumpusServer/Rumpus2.1Carbon
"
-Dave
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.