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?
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?
This thread is closed to new comments.
/usr/libexec/upsshutdown
script.posted by Pinback at 5:02 PM on September 8, 2011 [2 favorites]