Small helper to turn on and off my PC remotelly.
You will need at least one machine running in the network you want to turn on the machine(a raspberry will work). This program uses wake on lan to turn on the machine when it is off, you need to enable it on your machine.
Setup your machine to run the daemon. This daemon reports current status and receives commands such as shutdown and wake on lan commands to turn on the machine you want.
As backend, this uses firebase realtime database. Create a project and download the credentials file, you will need:
FIREBASE_DATABASE_URL
: URL of the firebase real time database, get it from admin firebase pageFIREBASE_CREDENTIALS_FILE
: is the path to the firebase credentials file.
You will need golang version 1.18+ and make
. Simply run make build
and the binary should be generated in bin
folder
- wakeonlan:
brew install wakeonlan
- wol:
yay -Sy wol
- WIP
You can build and create a link in your bin folder, just change your architecture sudo ln -s $(pwd)/bin/wakemypc_linux_amd64 /usr/bin/wakemypc
Make the service run in the startup of your machine. Currently it supports windows, mac and linux.
When setted up run wakemypc daemon
Create a service using wakemypc.service file template, place it in /etc/systemd/system/wakemypc.service
and run systemctl enable wakemypc.service
wakemypc daemon
List machines and states
wakemypc ls
Shutdowns the machine if it is connected to the network
wakemypc shutdown hostname|macaddress
Sends and event to all connected machines to try to wake up the machin
wakemypc wol hostname|macaddress