Python script for waking up device after a defined condition of a mail, like sender, subject or text content, or other things.
Python script for waking up devices with a mail with some defined condition.
This version is now working with a log file only. The idea is to run it on a RaspberryPy in background with setsid command.
I have set up a timer that increase/decrease the interval of checks looking at the hours of the day.
To run this script you need to have Python installed.
brew install python
You’ll also need this package:
pip install wakeonlan prettytable
There are 3 main variables necessary for the correct working of the software, MAC (of the devices to be waked), username and password of the mail account.
MAC = 'AA:BB:CC:DD:EE:FF' ---> MAC = 'your MAC address'
user = 'example' ---> user = 'your mail address'
...
To run the system use:
python mailcheck.py
For the MagicPacket check you can use Wireshark.
The software is studied to be runned in background like this:
setsid python mailcheck.py
the script will check every 2s the presence of a new mail, then it will compare the received mail with the fields that you want, in this case with the SUBJECT of the mail that it must to be equal to ‘WOL’ if it will be then scrit will send the MagicPacket to the specified MAC.
This software is build for managing the Keyboard Interrupt signal for the correct shutdown of the script.
The script can manage multiple situations:
This project is licensed under the MIT License - see the LICENSE.md file for details