Last year, one of my two "Busybox Newbie" projects was to create a routine that writes a date and time stamp to a log file each time the NAS is booted and then sends me an e-mail. This has all worked perfectly as designed, but I would like to add a refinement; this is to write a context sensitive log file entry and send a context sensitive e-mail depending on whether the boot is following a tidy power down or from a crash such as mains power failure.

Please can I have some pointers for easy tests to use to trigger this?

For info - In the interim (i.e for the few days since my post until today) I did it by editing S30usbmnt to write to the log file and send a power down e-mail when unmounting (since I never unmount USB apart from a NAS power down).