I wonder if anyone has any ideas on how to solve this thing.
I have a computer with power management enabled (sleep after 30 min), but since it also acts as server, this is in no way optimal.
My current solution is based on the /var/log/message-file, tail and grep.
echo "/usr/bin/ether-wake 00:00:00:A0:03:01" > /tmp/home/root/wakeup-mycomputer.sh chmod +x /tmp/home/root/wakeup-mycomputer.sh
while true; do tail -n2 /tmp/var/log/messages |grep -q -e "DPT=8080" -e "DPT=2222" -e "DPT=80" && (/tmp/home/root/wakeup-mycomputer.sh; logger -p syslog.info -- **Wake-on-LAN**); sleep 15; done
The wan-up-script could also go in a cron-job if the while-loop is removed.
This solution requires logging of "access restriction" to be enabled.
Now to the problem. If I'm downloading a torrent, I'll get a big amount of data in the log. Using [code]tail[/code] will of course limit the grep-command. Since computer is assumed to be awake when torrent is running, the wol will not be a problem, BUT the log file will requires lots of cycles to run.
I wonder if anyone has any ideas on how to solve this matter: "port 80,8080,22 etc triggers a WOL (unless computer in ARP)".
maybe smarter iptables rules for the "wake-ports"? Is it somehow possible to trigger a WOL using only the iptables? Any other ideas?
I don't want to use "port knocking" techniques as security isn't the main issue right here, just availability.
My router is a Linksys WRT54G 1.1 running TomatoUSB v1.28 9048.