Question: Is WOL on demand possible?

Started by lewoke, June 06, 2019, 08:22:18 PM

Previous topic - Next topic
Hi,

I'd like to do the following: Opnsense sends a WOL everytime  a client from LAN (own subnet) is requesting access to my home server on OPT1(own subnet).

I know there is the wol plugin but to my knowledge it only allows you to either wake up clients manually or via cron. Any ideas?


your server can call the same API the frontend is using to send the packet.

June 07, 2019, 08:40:05 PM #2 Last Edit: June 07, 2019, 10:33:56 PM by qinohe
@fabian, I'm curious how to do that are there examples anywhere?

@OP, you could use a script, untested, should work though, at least I think so  :P
#!/bin/sh

MAC='00:11:22:33:44:55'
IP='192.168.10.100'
ARP=$(arp "$IP"|awk '{print $4 $5}')

[ "$ARP" = noentry ] && wol -i "$IP" "$MAC" || exit
exit 0


edit: @fabian, NVM I found the examples in the wiki, I now need to figure out how to use them  :D