This utility consists of a set of bash scripts that can be used to scan your local network for devices and perform Wake-on-LAN (WOL) operations on them. The scripts are designed to run on FreeBSD.
- Bash
- Nmap
- Sudo
To download the prerequisites, you can use the following commands:
pkg install bash nmap sudo
To use these scripts, clone this repository to your local machine.
git clone https://github.com/Nobuyoshi-Lab/freebsd-wake-computer.git
cd freebsd-wake-computer
-
Edit the
data/mac-vendor.txt
file to add your desired MAC vendors. Thedefault.sh
script initializes this file with some common vendors. -
Run the
mac-search.sh
script to scan your local network and store the results in thedata/nmap-output.txt
file.
./scripts/mac-search.sh
- Run the
mac-test.sh
script to filter the MAC addresses by the specified vendors and store the results in thedata/found-mac.txt
file.
./scripts/mac-test.sh
- Run the
mac-wake.sh
script to perform WOL on the devices with the filtered MAC addresses.
./scripts/mac-wake.sh
To make the scripts available system-wide, you can create symbolic links in /usr/local/bin
. First, ensure that the scripts are executable by running:
chmod +x scripts/*.sh
Next, navigate to the root directory of the repository, and then create symbolic links:
cd /path/to/your_repository_directory
sudo ln -s "$(pwd)/scripts/mac-search.sh" /usr/local/bin/mac-search
sudo ln -s "$(pwd)/scripts/mac-test.sh" /usr/local/bin/mac-test
sudo ln -s "$(pwd)/scripts/mac-wake.sh" /usr/local/bin/mac-wake
Now, you can use the mac-search
, mac-test
, and mac-wake
commands from anywhere in your system.