Meet this Python Wake-on-LAN (WOL) Tool! It smartly checks your device status with integrated ping before sending the magic packet, ensuring efficiency. Set max wake devices, prevent power surges.
Project description
ping-before-wakeonlan
Meet this Python Wake-on-LAN (WOL) Tool! It smartly checks your device status with integrated ping before sending the magic packet, ensuring efficiency. Set max wake devices, prevent power surges.
Installation
% pip install ping-before-wakeonlan
or
% python3 -m venv venv
% source venv/bin/activate
% pip install ping-before-wakeonlan
% ./venv/bin/ping-before-wakeonlan
{
"count": 0,
"device": {
"failed": [],
"handled": [],
"input": [],
"online": [],
"skip": []
},
"info": [
"--device-info not set empty",
"stdin empty"
],
"maxCount": 5,
"ping": "ping -c 1 -W 3",
"version": "1.0.0"
}
usage: cmd.py [-h] [--max-wol-device MAX_WOL_DEVICE] [--send-mode {sequential,random}] [--silently] [--ping-cmd PING_CMD]
[--device-info DEVICE_INFO]
A Simple Tool for Ping and WOL Usage
options:
-h, --help show this help message and exit
--max-wol-device MAX_WOL_DEVICE
WOL device number per a run
--send-mode {sequential,random}
Adjust the order of input device
--silently Process Report
--ping-cmd PING_CMD Ping command for test device
--device-info DEVICE_INFO
a file path with JSON format with [{"ip": "192.168.1.2", "macAddress":"XX:XX:XX:XX:XX:XX"} ]
Usage
% cat /tmp/device.json
[
{
"ip": "192.168.1.1",
"mac_address": "00:00:00:00:00:01"
},
{
"ip": "192.168.1.2",
"mac_address": "00:00:00:00:00:02"
},
{
"ip": "192.168.1.3",
"mac_address": "00:00:00:00:00:03"
},
{
"ip": "192.168.1.4",
"mac_address": "00:00:00:00:00:04"
},
{
"ip": "192.168.1.5",
"mac_address": "00:00:00:00:00:05"
},
{
"ip": "192.168.1.6",
"mac_address": "00:00:00:00:00:06"
},
{
"ip": "192.168.1.7",
"mac_address": "00:00:00:00:00:07"
}
]
% ping-before-wakeonlan --device-info /tmp/device.json
Process: 1 / 7: Device: {'ip': '192.168.1.3', 'mac_address': '00:00:00:00:00:03'}
Process: 2 / 7: Device: {'ip': '192.168.1.2', 'mac_address': '00:00:00:00:00:02'}
Process: 3 / 7: Device: {'ip': '192.168.1.1', 'mac_address': '00:00:00:00:00:01'}
Process: 4 / 7: Device: {'ip': '192.168.1.4', 'mac_address': '00:00:00:00:00:04'}
Process: 5 / 7: Device: {'ip': '192.168.1.5', 'mac_address': '00:00:00:00:00:05'}
{
"count": 5,
"device": {
"failed": [],
"handled": [
{
"ip": "192.168.1.3",
"mac_address": "00:00:00:00:00:03"
},
{
"ip": "192.168.1.2",
"mac_address": "00:00:00:00:00:02"
},
{
"ip": "192.168.1.1",
"mac_address": "00:00:00:00:00:01"
},
{
"ip": "192.168.1.4",
"mac_address": "00:00:00:00:00:04"
},
{
"ip": "192.168.1.5",
"mac_address": "00:00:00:00:00:05"
}
],
"input": [
{
"ip": "192.168.1.3",
"mac_address": "00:00:00:00:00:03"
},
{
"ip": "192.168.1.2",
"mac_address": "00:00:00:00:00:02"
},
{
"ip": "192.168.1.1",
"mac_address": "00:00:00:00:00:01"
},
{
"ip": "192.168.1.4",
"mac_address": "00:00:00:00:00:04"
},
{
"ip": "192.168.1.5",
"mac_address": "00:00:00:00:00:05"
},
{
"ip": "192.168.1.6",
"mac_address": "00:00:00:00:00:06"
},
{
"ip": "192.168.1.7",
"mac_address": "00:00:00:00:00:07"
}
],
"online": [],
"skip": [
{
"ip": "192.168.1.6",
"mac_address": "00:00:00:00:00:06"
},
{
"ip": "192.168.1.7",
"mac_address": "00:00:00:00:00:07"
}
]
},
"info": [
"cmd: ['ping', '-c', '1', '-W', '3', '192.168.1.1'], item: {'ip': '192.168.1.1', 'mac_address': '00:00:00:00:00:01'}",
"processOutput: b'PING 192.168.1.1 (192.168.1.1): 56 data bytes\\n\\n--- 192.168.1.1 ping statistics ---\\n1 packets transmitted, 0 packets received, 100.0% packet loss\\n', processError: None"
],
"maxCount": 5,
"ping": "ping -c 1 -W 3",
"status": true,
"version": "1.0.0"
}
or
% cat /tmp/device.json | ping-before-wakeonlan
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ping_before_wakeonlan-1.0.2.tar.gz.
File metadata
- Download URL: ping_before_wakeonlan-1.0.2.tar.gz
- Upload date:
- Size: 5.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4083306a694001ed2b542730ebb8c503335dfe797f0399f45311d21868d04885
|
|
| MD5 |
8df2c28b1c10d9bc35b86f3d42435e30
|
|
| BLAKE2b-256 |
6bfd992049f1e4dbecda4a375f287c7712cfd2098e3d30d8c4112118ad1537e3
|
Provenance
The following attestation bundles were made for ping_before_wakeonlan-1.0.2.tar.gz:
Publisher:
python-publish.yml on changyy/ping-before-wakeonlan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ping_before_wakeonlan-1.0.2.tar.gz -
Subject digest:
4083306a694001ed2b542730ebb8c503335dfe797f0399f45311d21868d04885 - Sigstore transparency entry: 229901348
- Sigstore integration time:
-
Permalink:
changyy/ping-before-wakeonlan@e477b046827c8b2512f6b9260f815c62705da18f -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/changyy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e477b046827c8b2512f6b9260f815c62705da18f -
Trigger Event:
release
-
Statement type:
File details
Details for the file ping_before_wakeonlan-1.0.2-py3-none-any.whl.
File metadata
- Download URL: ping_before_wakeonlan-1.0.2-py3-none-any.whl
- Upload date:
- Size: 5.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
832353131f1218d8f6a521f6c4c76c5afa663df8a7fb7c219e90976c8e0e272b
|
|
| MD5 |
941ea7bc60e0b98da946ab068c97c516
|
|
| BLAKE2b-256 |
002fd5cde05207e0e15b6c203e44a09500e29b7dffe274c858f53d7ff8642888
|
Provenance
The following attestation bundles were made for ping_before_wakeonlan-1.0.2-py3-none-any.whl:
Publisher:
python-publish.yml on changyy/ping-before-wakeonlan
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ping_before_wakeonlan-1.0.2-py3-none-any.whl -
Subject digest:
832353131f1218d8f6a521f6c4c76c5afa663df8a7fb7c219e90976c8e0e272b - Sigstore transparency entry: 229901350
- Sigstore integration time:
-
Permalink:
changyy/ping-before-wakeonlan@e477b046827c8b2512f6b9260f815c62705da18f -
Branch / Tag:
refs/tags/1.0.2 - Owner: https://github.com/changyy
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@e477b046827c8b2512f6b9260f815c62705da18f -
Trigger Event:
release
-
Statement type: