Trying to find a way to run a shutdown hook on mac from a command-line background process.
Tried using NSWorkspaceWillPowerOffNotification, which was never called. Also tried kIOMessageSystemWillPowerOff event and that did not run either.
Anyone has any idea?
Tried using NSWorkspaceWillPowerOffNotification, which was never called. Also tried kIOMessageSystemWillPowerOff event and that did not run either.
Anyone has any idea?