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

Apocrathia

macrumors 6502
Original poster
Jan 6, 2009
276
0
University of South Alabama
That little prompt you get when you go through the apple menu at the top left and hit shut down. It gives you 60 seconds, etc...
I want to know how to initiate that from the terminal. I keep apcupsd running on my mac mini server, and if the power goes out, i want it to tell my machines to shut down. I already have a growl message setup letting me know when the power goes out (forwarded to my iphone over prowl, etc etc). I can ssh into the systems via bash scripting and issue the command, that's np. I just have no idea wtf the command is to throw that prompt.
Anyone have any ideas?
 
You can make an Applescript to do that. Just make sure to do a DisplayDialog and shell scripting. In Terminal.app you can type: shutdown -r now (restart), etc.
 
halt and shutdown always work, but i want to find something that will display a message. The applescript idea seems to be a good route, the question is how do i execute applescript from within a bash script. I still haven't even really touched applescript before. I've heard it's a pretty simple language.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.