Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

jimsowden

macrumors 68000
Original poster
Sep 6, 2003
1,766
18
NY
I don't use apple script, but i want to get started. I work at an apple dealer, and i want to write a script to shut down all the demo computers. I know how to do this remotley, which is to
open terminal,
type in ssh user@ipaddress
it prompts for password
enter sudo -s
it enters password
enter shutdown -h now.

I would need this for more than one computer obviously, so if anyone it up to it, a starter script would be much appriciated.
 
Is this something you need to do at random times throughout the day, or do you just want to shut them down at night before you leave?

If it's the latter, you can use the System Prefs > Energy Saver to tell them to shut down at a certain time every day.
 
emw said:
Is this something you need to do at random times throughout the day, or do you just want to shut them down at night before you leave?

If it's the latter, you can use the System Prefs > Energy Saver to tell them to shut down at a certain time every day.
I know about that. I can't get it to do different days and remember. It doesn't work that well.
 
Ok, i got this far:

tell application "Terminal"
activate
do shell script "sudo ssh jimsowden@10.0.1.3" password "xxx" with administrator privileges
do shell script "shutdown -h now"
end tell

That opens it. Now, it should log me in, but it says "Terminal got an error: Pseudo-terminal will not be allocated because stdin is not a terminal.
Host key verification failed."

Any ideas?
 
If you work at an Apple dealer, why not just use Remote Desktop, manage your demo computers as a group, and just shut them all down at once?

cpjakes
 
Net admin won't let me. I wanted to have netboot, but that was out of the question. This is all i got. I got to typing

tell application "terminal" to do shell script "ssh jimsowden@10.0.1.3" password "xxx" with administrator privileges

but this returns a psuedo terminal error. I have no idea why.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.