This script provides a simple command-line tool for managing and waking up remote machines using Wake-on-LAN (WoL). It supports both Linux (Ubuntu) and macOS, with automatic detection of MAC addresses and broadcast IPs.
- ✅ Wake-on-LAN automation
- ✅ Automatically retrieves MAC address from IP
- ✅ Automatically detects broadcast IP
- ✅ Verifies if
wakeonlan
is installed - ✅ Stores and manages multiple machines
- ✅ Checks if a machine wakes up (ping for 30s)
- ✅ Cross-platform: Linux & macOS
Ubuntu/Linux
sudo apt install wakeonlan
macOS
brew install wakeonlan
git clone https://github.com/mboyov/wakecli.git
cd wakecli
# Make sure the main script is executable
chmod +x bin/wake.sh
# Optional: install globally (requires sudo)
sudo ln -s "$(pwd)/bin/wake.sh" /usr/local/bin/wake
ℹ️ If you install globally, the config will be stored at
~/.config/wakecli/hosts
.
echo "alias wol='wake wake'" >> ~/.zshrc
source ~/.zshrc
wakecli/
├── bin/ # Main CLI script
│ └── wake.sh
├── config/ # Default machine database (example)
│ └── hosts
├── lib/ # Shared functions
│ ├── utils.sh
│ └── network.sh
├── tests/ # Test runner
│ └── wake.sh
└── README.md
wake add <machine_name> <ip_address>
Example:
wake add neoserv 192.168.1.10
wake list
wake wake <machine_name>
wake remove <machine_name>
- Gets the MAC address from the ARP cache or
ip neigh
. - Derives the broadcast IP from your interface.
- Sends a WoL packet to the target.
- Waits up to 30 seconds, pinging every 2s.
- Reports success or failure.
- Wake-on-LAN must be enabled in BIOS/UEFI.
- Use
wake list
to check saved MAC/broadcast info. - Try sending manually:
wakeonlan <mac_address>
- Ensure the machine is connected via Ethernet.
- WoL does not work over Wi-Fi in most cases.
This tool is open-source. Use it, improve it, share it.
GitHub: mboyov/wakecli
🚀 You now have a clean, reliable CLI for waking up your machines. Enjoy!