OSX: Run script on UPS shutdown?
September 8, 2011 4:46 PM   Subscribe

Can I run a script when my mac shuts down due to instructions from a UPS?

I'm planning UPS setup for my home. I would like to connnect a mac mini (running Lion), and a netgear ReadyNAS NV+, and I need them both to shutdown gracefully when the power goes out. I believe I can shut the ReadyNAS down by invoking a particular curl command. What I don't know is whether I can get OSX to run this command on a shutdown instruction from the EnergySaver UPS panel.

So, how can I run a shell script on this particular kind of shutdown (Applescript could work too). I don't really want this to happen every time I shut the mac down... only when this was invoked by the UPS.

Alternatively, is there a better way to achieve this aim?
posted by pompomtom to Computers & Internet (2 answers total) 1 user marked this as a favorite
 
Best answer: Assuming the UPS software hooks into the standard OS X UPS management, you should be able to replace / modify the /usr/libexec/upsshutdown script.
posted by Pinback at 5:02 PM on September 8, 2011 [2 favorites]


Response by poster: Thank you!
posted by pompomtom at 5:16 PM on September 8, 2011


« Older Gratuitous Self Promotion   |   FCP, Non-Standard Pixel Dimensions and Crashes Oh... Newer »
This thread is closed to new comments.