Can i get a mac mini to boot by default when plugged in?

I am searching very long for a solution for this:

I want my mac mini to start by plugging in or an external switch even if there was no power failure. (which can be set in the energy saver preferences, box checked))


I found a thread which partly seems to concern this question, but i am not sure, may be some members here with more knowledge than me could help me, i would be very pleased:


https://discussions.apple.com/thread/2543898?answerId=12111266022#12111266022


there i found the following:


"edited /usr/libexec/upsshutdown to send "shutdown -hu now" in both a normal shutdown or UPS shutdown. the -u simulates a dirty shutdown (see man shutdown) so when the UPS does powercycle it brings the Mac back online." posting by Glenn Gerrad

This seems to me as if i could use this change just to simulate dirty shut down indepenedent of having this APC UPS this thread is about, but i am not sure how to start this change for i am not used to work with the terminal and im afraid of ruining something because i am really unsure about the whole meaning of this thread. May be someone experienced can help me what to do?


Thank you !


(at the moment i am using hibernate, which works but i would prefer restart, because i eperienced some strange things which i could avoid by a clean start up.)

Posted on May 1, 2011 4:54 AM

Reply
12 replies

May 5, 2011 1:35 AM in response to Alfi

So just -u is wrong. You have to use -uh. Ok tried it with the iMac here:


sudo shutdown -hu now


Entered Password -> the iMac went down. Pulled off the power cord -> waited 20 seconds -> replugged the power cord -> iMac powered on.


Go to Terminal and type:


pmset -g


Hit ENTER and read the output. Is there a line with "autorestart 1"?


AND: When the screen went black you have to take away the power within 5 minutes, otherwise it won't work.

May 6, 2011 1:54 AM in response to Alfi

1.) Open Automator (Applications) and choose "Application" on startup.

2.) Find "Run AppleScript" in the list on the left side

3.) Drag & Drop that action to the right side

4.) In the text field of the script insert


do shell script "sudo shutdown -hu now" with administrator privileges


5.) Save that application to your hard drive and you can double click it.

6.) When running that application you have to enter your password, and it will shutdown the mac.

7.) You can hard code your password to the program with


do shell script "sudo shutdown -hu now" with administrator privileges password "yourpassword"


But the password isn't encrypted in the Shell Script!


Be aware: double clicking that application will immediately shut down the computer without asking for saving changed files - they'll be lost!

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Can i get a mac mini to boot by default when plugged in?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.