Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
How to detect if Mac if rebooting after a power failure using terminal?
As I asked in the title, how can I check if a Mac is rebooting after experiencing a power failure. It would be preferable to check this using terminal or some other script, as I would like to test this automatically in a script upon system startup.