7 unstable releases (3 breaking)
Uses new Rust 2024
| 0.5.0 | Feb 26, 2026 |
|---|---|
| 0.4.0 | Aug 29, 2025 |
| 0.3.1 | May 3, 2025 |
| 0.3.0 | Mar 30, 2025 |
| 0.1.1 |
|
#536 in Network programming
74 downloads per month
Used in wol-relay
62KB
1K
SLoC
wol.rs
Wake On LAN magic packet command line tool and crate.
Command line
Wake up a single host:
$ wol --verbose --port 42 12:13:14:15:16:17
Waking up 12:13:14:15:16:17 with 255.255.255.255:42...
Wake up a list of hosts, including an optional SecureON token:
$ cat home-lab
12:13:14:15:16:17 9
12:23:24:25:26:27 9 cd-23-ae-9d-3f-c2
$ wol --file=home-lab
Waking up 12:13:14:15:16:17...
Waking up 12:23:24:25:26:27...
See wol --help for more information.
Installation
- Linux binary attached to releases
- Arch binary package
cargo install --all-features wol- 3rd party packages: Repology
For packaging, all releases have reproducible git archive and cargo vendor
bundles attached, signed by my SSH key from https://codeberg.org/swsnr.keys.
I recommend to first build with --all-features, then dump the manpage and
desired completions with --print-manpage and --print-completions, and
eventually build with --features cli to remove these options from the final
binary. See arch package above for an example.
Crate
You can also use wol as a Rust crate, with cargo add wol:
use std::str::FromStr;
use std::net::Ipv4Addr;
let mac_address = wol::MacAddress::from_str("12-13-14-15-16-17").unwrap();
wol::send_magic_packet(mac_address, None, (Ipv4Addr::BROADCAST, 9).into()).unwrap();
See https://docs.rs/wol for detailed documentation.
License
Copyright Sebastian Wiesner sebastian@swsnr.de
Licensed under the EUPL, see https://interoperable-europe.ec.europa.eu/collection/eupl/eupl-text-eupl-12
Dependencies
~0–14MB
~119K SLoC