• Stars
    star
    175
  • Rank 218,059 (Top 5 %)
  • Language
    Python
  • License
    Other
  • Created almost 11 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A small Python script to allow the sending of a WOL Magic packet

Wake-On-Lan-Python

wol.py is A small Python 3 script to allow the sending of a WOL Magic packet so that LAN clients can be remotely switched on from another machine on the same subnet. Rather than needing to know the MAC address of the desired machine, the script allows you to specify by hostname, so long as that host is included in the configuration file.

For a quick and lazy way to create the configuration file, see The Wake On Lan section of my router build documentation, or run the command without arguments to create a default config file in ~/.config/bentasker.Wake-On-Lan-Python/wol_config.ini

This is based on a recipe from http://code.activestate.com/recipes/358449-wake-on-lan/ which was then ameded to use a config file and hostnames.

Usage

wol.py [-p] [hostname|list]

-p            Prompt for input before exiting
list          List configured hosts
[hostname]    hostname to wake (as listed in list)

or

wol.py list

Usage: Docker

It is also possible to run the utility with Docker, however there is a small additional configuration step required the first time that it's run

Run list:

docker run \
--rm \
-v ~/.config/bentasker.Wake-On-Lan-Python/:/wol_config \
bentasker12/wake-on-lan-python list

Edit the generated configuration file

vi ~/.config/bentasker.Wake-On-Lan-Python/wol_config.ini

You will find that the broadcast address is for the wrong network, replace this with the correct prefix

[General]
broadcast = 172.0.1.255

becomes

[General]
broadcast = 192.168.1.255

Subsequent runs should then run as desired

docker run \
--rm \
-v ~/.config/bentasker.Wake-On-Lan-Python/:/wol_config \
bentasker12/wake-on-lan-python myPC

Configuration File

The configuration file is just a basic INI file, containing one section per host;

By default, the configuration file is located at ~/.config/bentasker.Wake-On-Lan-Python/wol_config.ini

The location can be overridden via environment variable WOL_CONFIG_DIR:

export WOL_CONFIG_DIR="/some/path/wol_config

If it does not exist, it will be created and wol_config.ini created within it.

The following is an example of hosts save in wol_config.ini

[General]
broadcast=192.168.1.255

[MyPc]
mac=00:13:0d:e4:60:61

License

Copyright (c) Fadly Tabrani, B Tasker, released under PSF v2, see LICENSE

More Repositories

1

HLS-Stream-Creator

Simple Bash Script to take a media file, segment it and create an M3U8 playlist for serving using HLS
Shell
270
star
2

HomeAssistantAddons

Shell
30
star
3

PHP-GPX-Ingest

Simple class to ingest a basic GPX file and extract data/stats from it
PHP
26
star
4

RemoveAMP

A small script to be pulled in by Greasemonkey, attempting to locate non AMP versions of pages and direct the user there
JavaScript
17
star
5

Ecowitt_to_InfluxDB

Python
8
star
6

telegraf-plugins

Python
6
star
7

Golang-SSH-Tarpit

Go
5
star
8

BackupEncryptionScripts

Simple BASH scripts for encrypting backups
Shell
5
star
9

gadgetbridge_to_influxdb

Script to fetch a copy of the Gadgetbridge database and extract data for Huami devices for writing onwards into InfluxDB
Python
5
star
10

tplink_to_influxdb

Python
4
star
11

mod_bgithub_feed

Simple Joomla module to embed a list of a user's repositories into a Joomla! based web site
PHP
3
star
12

adblocklists

I've been running my own AdblockPlus/UblockOrigin list for a while, but wanted to start recording why certain domains were blocked. So moving into a repo for that purpose
JavaScript
3
star
13

PHPCredLocker

PHPCredLocker is a secure web-based repository for credentials. Intended for teams who need to share credentials, the system aims to store all content securely
PHP
3
star
14

Jira-Webhook-Listener

A small script to catch JIRA webhook events and send notifications/run custom code
PHP
3
star
15

docker_openresty_geoip

Dockerfile
2
star
16

adblock_lists_v2

Shell
2
star
17

nginx_log_actions

NGinx Log Actions is a small processing script designed to read in an NGinx access log and perform custom actions on a per domain basis.
PHP
2
star
18

nikola_ssg_webmentions

Python
1
star
19

zepp_to_influxdb

A script to pull data from the Zepp/AmznFit/Huami/MiFit and write it onwards into InfluxDB
Python
1
star
20

article_scripts

A repo to hold miscellaneous scripts that I create for articles/posts (the plan is to also backfill a bit at some point)
C
1
star
21

docker-nextcloud

Dockerfile
1
star
22

DNSChat

A simple proof of concept
Python
1
star
23

URLBrand

URLBrand is a small PHP Project allowing for the generation of short URLs (so long as you have a short domain name to use).
PHP
1
star
24

LocalChat

Localchat is a simple and lightweight chat application. It's primary purpose is to provide a means to have a multi-user Off-The-Record transient chat
Python
1
star