Documentation updates.

This commit is contained in:
Dan Helfman 2022-06-12 18:26:05 -07:00
parent 46387d5350
commit 38f367b47a
2 changed files with 23 additions and 4 deletions

View File

@ -29,7 +29,8 @@ send a wake-on-lan packet to. It expects plain TCP requests, not HTTP.
## Environment variables
* `PORT`: The TCP port to listen on for wake-on-lan requests, defaults to 18888.
* `PORT`: The TCP port to listen on for wake-on-lan requests, defaults to
18888. Don't forget to open this port in your firewall.
## Example
@ -60,7 +61,7 @@ From within another container running on a Docker bridge network (so, no need
to run on the host network), execute:
echo "00:00:0A:BB:28:FC" | nc -N host.docker.internal 18888
echo 00:00:0a:bb:28:fc | nc -N host.docker.internal 18888
This example uses the OpenBSD netcat variant to send a TCP packet containing
@ -73,12 +74,30 @@ host.docker.internal:host-gateway ...`. Or, with Docker Compose:
- "host.docker.internal:host-gateway"
- "host.docker.internal:host-gateway"
Alternatively, on Linux, you can try using the IP ``.
### Home Assistant
If you happen to be using Home Assistant, here's how you might request
wake-on-lan of a remote server via wake-on-lan-service. This example is of an
automation action in your Home Assistant configuration:
- alias: my automation
trigger: ...
- service: shell_command.wake_my_server
wake_my_server: "echo 00:00:0a:bb:28:fc | nc -N host.docker.internal 18888"
## Security
Note that no authorization is performed on the service request, so be aware

View File

@ -3,6 +3,6 @@
set -u
while true; do
mac=$(nc -l -p "$PORT" | sed 's/[^a-f0-9:]//g')
mac=$(nc -l -p "$PORT" | sed 's/[^a-fA-F0-9:]//g')
awake "$mac"