I'm looking for a way (programmatically or otherwise) to determine if my machine was woken up by WOL or not (let's say, a Ubuntu Server box).
This is sort of a two-fold question, where I want to know if I can:
a) Hook something that'll hear about being woken up when the machine comes out of sleep and
b) Can then determine somehow whether the wake was due to WOL or not
I'm not too concerned by what mechanism (if any) this is achieved, but am interested really in whether it's even possible.
Maybe if there was some file that logged wake up/sleep times, I could write a small program that looped and occasionally checked the file for changes, but don't know what i'd need to do to figure out of it was WOL or not (or if such a file exists).