Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Mac OS X > an easy unconditional shutdown script please?

an easy unconditional shutdown script please?
Thread Tools
Addicted to MacNN
Join Date: Oct 2001
Location: Automatic
Status: Offline
Reply With Quote
Sep 8, 2007, 10:37 AM
 
that is it… I need a script that once I clic on it -is supposed to be placed in the Dock- the Mac shall shutdown no matter what… it has to be so because an intel iMac has difficulties to shutdown properly, I think the culprit could be some Lexmark PowerPC drivers… I also found a startup item dubbed LexSleeper also from Lexmark that doesn't seem like a good guy so to speak… so I would like that in case of the iMac owner needing it, just clic that cute icon sitting in the Dock and the iMac shall shutdown without hassle.

Many thanks.


"That plane's dustin' crops where there ain't no crops."
     
Posting Junkie
Join Date: Oct 2005
Location: Houston, TX
Status: Offline
Reply With Quote
Sep 8, 2007, 11:01 AM
 
A little terminal script for

shutdown -h now

should do the trick.
     
angelmb  (op)
Addicted to MacNN
Join Date: Oct 2001
Location: Automatic
Status: Offline
Reply With Quote
Sep 8, 2007, 01:01 PM
 
Thanks Mark, but I am a moron when it comes to deal with scripts and so… Would it work if anyone upload such script so I can download it to use on another Mac?, I wonder… it is going to ask for the super-user password… maybe the script could prompt the user about the root password and once the user writes it down correctly the Mac does shutdown…


"That plane's dustin' crops where there ain't no crops."
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Sep 8, 2007, 02:10 PM
 
Originally Posted by angelmb View Post
Thanks Mark, but I am a moron when it comes to deal with scripts and so… Would it work if anyone upload such script so I can download it to use on another Mac?, I wonder… it is going to ask for the super-user password… maybe the script could prompt the user about the root password and once the user writes it down correctly the Mac does shutdown…
The hard part is not creating the script, but installing it and giving it proper permissions. This you will have to do yourself.


1) Open Terminal
2) File->Save As...
3) Click on "execute this command" and enter "sudo shutdown -h now"
4) save this file somewhere, drag this icon to the dock
     
angelmb  (op)
Addicted to MacNN
Join Date: Oct 2001
Location: Automatic
Status: Offline
Reply With Quote
Sep 8, 2007, 04:09 PM
 
Thanks besson… that's almost what I was trying to do and failed once and again… Maybe cause when I saved the file I had also typed the "sudo shutdown -h" command on the proper Terminal window…

Nice, it worked with my Mac, now I have to wait until the iMac gets the way back to its home and see if it keeps having a hard time to do a proper shutdown so the term file is going to be needed.

Thanks again to both of you.


"That plane's dustin' crops where there ain't no crops."
     
Professional Poster
Join Date: Jun 2001
Location: Northwest Ohio
Status: Offline
Reply With Quote
Sep 11, 2007, 10:51 AM
 
Originally Posted by angelmb View Post
Thanks besson… that's almost what I was trying to do and failed once and again… Maybe cause when I saved the file I had also typed the "sudo shutdown -h" command on the proper Terminal window…

Nice, it worked with my Mac, now I have to wait until the iMac gets the way back to its home and see if it keeps having a hard time to do a proper shutdown so the term file is going to be needed.

Thanks again to both of you.
The only thing is that the iMac will still go through the normal shutdown procedure, potentially hanging in the same place.

The best thing would be to get rid of the "Lexmark sleeper" thing entirely.
     
Addicted to MacNN
Join Date: Mar 2006
Status: Offline
Reply With Quote
Sep 11, 2007, 11:02 AM
 
I might try this - I find the normal shutdown process on my powerbook extremely frustrating.
1. Click shutdown.
2. Click on confirm dialogue.
3. Wait.
4. Some app asks you whether you really want to close.
5. Click yes.
6. Wait.
7. Repeat steps 4-6 3 times.
8. Shutdown times out - go back to 1.
9. etc.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Sep 11, 2007, 03:59 PM
 
You'll regret it the first time you realize you forgot to save that document you just spent a grueling hour or two perfecting.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Addicted to MacNN
Join Date: Mar 2006
Status: Offline
Reply With Quote
Sep 11, 2007, 04:19 PM
 
Originally Posted by Chuckit View Post
You'll regret it the first time you realize you forgot to save that document you just spent a grueling hour or two perfecting.
I regret the whole idea of 'Save'. I mean, only in the computer world would you have a function that you have to actively invoke that means "Don't throw away everything I've been working on". Apps should automatically 'save'.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Sep 11, 2007, 06:35 PM
 
Originally Posted by peeb View Post
I regret the whole idea of 'Save'. I mean, only in the computer world would you have a function that you have to actively invoke that means "Don't throw away everything I've been working on". Apps should automatically 'save'.
That's entirely possible, but you have to consider that for many apps, "Save" means "do nothing for 15 seconds." I don't know about you, but I wouldn't want my computer to suddenly grind to a halt every few seconds when all my apps decide to save changes that I might not even have wanted to keep.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
angelmb  (op)
Addicted to MacNN
Join Date: Oct 2001
Location: Automatic
Status: Offline
Reply With Quote
Sep 12, 2007, 03:40 AM
 
Yes, any lexmark item removed… the owner told me she no longer has that lexmark… I guess she is not going to lost any job done since the issue here is that once she tries to shutdown the iMac it just hangs having to do it the hard way (unplugging it)… it is common sense to think all the apps are gonna be closed by then… Anyway, I still think that Lexmark software was the culprit… let's wait and see how it goes now that it is gone.


"That plane's dustin' crops where there ain't no crops."
     
Clinically Insane
Join Date: Oct 2000
Location: Los Angeles
Status: Online
Reply With Quote
Sep 12, 2007, 03:48 AM
 
Originally Posted by peeb View Post
I regret the whole idea of 'Save'. I mean, only in the computer world would you have a function that you have to actively invoke that means "Don't throw away everything I've been working on". Apps should automatically 'save'.
If that's what you want, turn on auto-save. I'd rather save when I want to save, manually; that way, if I have made a change that I don't like, I can choose to close without saving.

"The natural progress of things is for liberty to yield and government to gain ground." TJ
     
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Sep 12, 2007, 08:48 AM
 
I have a hard time understanding why a Lexmark driver would prevent shutdown, but... Hope it is the culprit, so that this person's machine can be fixed
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 08:37 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2