/home/martijn

My personal blog

Introducing PyWake

Recently I wrote a python script to take care of my wake-on-lan needs. It reads a json formatted config file:

1
2
3
4
5
6
7
8
9
10
{
    "hostname" : {
        "mac" : "xx:xx:xx:xx:xx:xx",
        "ip" : "10.0.0.101"
    },
    "hostname" : {
        "mac" : "xx:xx:xx:xx:xx:xx",
        "ip" : "10.0.0.102"
    }
}

The config file resides in ~/.wakefile.json. This makes it possible to include it in your dotfiles for easy updating.

PyWake sends the wol packet using the awake library to send the wol packet. After sending the wol packet PyWake pings the ip address specified in the json file until it gets a response.

Comments