I have had this irritating issue for some time now. Basically, I like to leave my iMac sleeping but leave it listening for WOL packets for remote access. I know that Macs will wake every 2 hours or so to register with their base station (if you have one) but they immediately return to sleep.
My problem is that due to whatever reason (presumably something like bots sending out magic packets to random IP addresses and trying passwords to gain access) whenever the Mac receives a magic packet, it wakes (display still off) but doesn't go back to sleep if it receives no further network activity.
I downloaded sleepwatcher but I'm not really sure how to use it properly. I think I basically need a very small piece of code that waits maybe 30 seconds and if no network connectivity is detected, goes back to sleep. I know that requesting code is usually frowned upon here and I usually don't but in this instance, I'm struggling with where to even begin.
As a side question, is it possible to log the IP address that sent the magic packet? That could be helpful too, if it is coming from the same IP, I can simply block it.
I'd really appreciate any help on this.
Thanks,
Scott