A HTTP server who sends a Wake On LAN package on an HTTP request.
/api/wakeup/computer/<hostname> - Returns a JSON object
{
"success":true,
"message":"Succesfully Wakeup Computer Computer1 with Mac 64-07-2D-BB-BB-BF on Broadcast IP 192.168.10.254:9",
"error":null
}
Variable Name | Description |
---|---|
WOLHTTPPORT | Define the port on which the webserver will listen to (Default: 8080) |
WOLFILE | Path to the CSV file containing the list of hosts (Default: ./computer.csv) |
Commandline argument | Example | Description |
---|---|---|
--port | --port 80 | Define the port on which the webserver will listen to (Default: 8080) |
--file | --file comp.csv | Path to the CSV file containing the list of hosts (Default: ./computer.csv) |
<name of the computer>,<mac address of the computer>,<broadcast ip to send the magic packet>
name,mac,ip
Computer1,64-07-2D-BB-BB-BF,192.168.10.254:9
Computer2,2D-F2-3D-06-17-00,192.168.10.254:9
Computer3,FF-B3-95-62-1C-DD,192.168.10.254:9
Docker Image: dabondi/go-rest-wol
docker build -t go-rest-wol .
docker run go-rest-wol
If you want to run it on a different port (i.e.: 6969) and also want to provide the CSV file on your host:
docker run -p 6969:8080 -v $(pwd)/externall-file-on-host.csv:/app/computer.csv dabondi/go-rest-wol
If you want to run the WOL Webserver Process in the Webserver on a different Port:
# Used if you run in Network Host Mode
docker run -e "WOLHTTPPORT=9090" -p 9090:9090 -v $(pwd)/externall-file-on-host.csv:/app/computer.csv dabondi/go-rest-wol
This was a good exercise to learn Golang (and refresh my Docker skills).
Thx https://github.com/sabhiram/go-wol for the WOL code, sorry that I stole it from you, because I got no clue how I can inject it into my program. :-(
If you have any good ideas, I'm open for pull requests.