- Document wake and sleep subcommands - Update usage examples to reflect new command structure - Clarify default ports for each command (wake: 9, sleep: 9999) - Improve documentation formatting and organization
1.8 KiB
1.8 KiB
Wake on LAN (WOL) CLI tool with authentication support
Description
This is a CLI tool that sends Wake on LAN (WOL) and Sleep packets to a target device. It supports authentication using a username and password.
Usage
The tool now uses subcommands for different operations:
Wake Command (sends WOL packet on port 9)
python index.py wake -m AA:BB:CC:DD:EE:FF -u admin -p secret
Sleep Command (sends sleep packet on port 9999)
python index.py sleep -m AA:BB:CC:DD:EE:FF -u admin -p secret
Commands
wake
Send a Wake-on-LAN packet to wake up a target device (default port: 9)
sleep
Send a Sleep packet to put a target device to sleep (default port: 9999)
Arguments
Both commands share the same arguments:
-m, --mac: MAC address of the target device (format: XX:XX:XX:XX:XX:XX or XX-XX-XX-XX-XX-XX) [required]-u, --username: Username for authentication [required]-p, --password: Password for authentication [required]-H, --host: Target host address (default: 255.255.255.255 for broadcast)-P, --port: Target UDP port (default: 9 for wake, 9999 for sleep)
Examples
Wake up a device:
python index.py wake -m AA:BB:CC:DD:EE:FF -u admin -p secret -H 192.168.1.100
Put a device to sleep:
python index.py sleep -m AA:BB:CC:DD:EE:FF -u admin -p secret -H 192.168.1.100 -P 9999
Notes
- The tool sends packets using the UDP protocol.
- The tool supports authentication using a username and password.
- The tool supports broadcasting to the target host address.
- The tool supports specifying the target UDP port.
- Default ports differ between commands: wake uses port 9, sleep uses port 9999.
License
This project is licensed under the MIT License - see the LICENSE.md file for details.