title: Run a script only at shutdown (not log off or restart) on Mac OS X
body: <p>Is there any way to run a script only at shutdown?</p>
  
  <p>I mean, only when the computer is really shutting down to off state. This script should not run when doing just a log off or restart.</p>