|
|
5 月之前 | |
|---|---|---|
| .config | 5 月之前 | |
| config | 5 月之前 | |
| .gitignore | 5 月之前 | |
| Dockerfile | 5 月之前 | |
| config.ini | 5 月之前 | |
| docker-compose.yml | 5 月之前 | |
| dynip.py | 5 月之前 | |
| ip_notifier.py | 5 月之前 | |
| last_ip.txt | 5 月之前 | |
| readme.md | 5 月之前 | |
| requirements.txt | 5 月之前 |
==========================
This script is designed to monitor and notify when the public IP address of a device changes. It uses various notification methods, including email, Telegram, and Nextcloud Talk.
The script relies on a configuration file named config.ini to store settings. The file should be in the same directory as the script.
check_interval: The interval in seconds between IP checks (default: 300)notify_methods: A comma-separated list of notification methods (default: email)last_ip_file: The file to store the last known IP address (default: last_ip.txt)from: The sender's email addressto: The recipient's email addressserver: The SMTP server addressport: The SMTP server port (default: 465)user: The SMTP usernamepass: The SMTP passwordbot_token: The Telegram bot tokenchat_id: The Telegram chat IDurl: The Nextcloud URLtoken: The Nextcloud tokenroom: The Nextcloud room IDconfig.ini.get_public_ip function.last_ip_file.The script supports the following notification methods:
To run the script, simply execute it using Python:
python ip_notifier.py
Note: Make sure to replace ip_notifier.py with the actual script name.
If you encounter any issues, check the script's output for error messages. Ensure that the configuration file is correct and that the notification methods are properly set up.