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:
```bash
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
@ -79,6 +80,24 @@ extra_hosts:
Alternatively, on Linux, you can try using the IP `172.17.0.1`.
### 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:
```
automation:
- alias: my automation
trigger: ...
action:
- service: shell_command.wake_my_server
shell_command:
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

2
run.sh
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"
done