Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/huangy10/AutoIPChangeNotifier
A python script to notify the changes of server IP
https://github.com/huangy10/AutoIPChangeNotifier
Last synced: 2 months ago
JSON representation
A python script to notify the changes of server IP
- Host: GitHub
- URL: https://github.com/huangy10/AutoIPChangeNotifier
- Owner: huangy10
- Created: 2016-07-01T07:56:54.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-10-18T15:13:40.000Z (over 8 years ago)
- Last Synced: 2024-08-03T01:38:37.030Z (6 months ago)
- Language: Python
- Size: 9.77 KB
- Stars: 4
- Watchers: 1
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
This script enables the server to report its ip addresses after change by sending emails.
### Config:
Configurations are divided into two parts.
First you should check the script `runner.py`, and set the following variables:
- `SERVERNAME`: the name for your server.
- `EMAIL`: the email account you use to send emails
- `PASSWROD`: password of the email account (Notice that if you use 163.com email account, you should use the password for mobile devices instead of the login password)
- `SMTP_SERVER`: get this setting from your email service provider
- `SMTP_PORT`:Second, add the emails which you want to be notified when the IP of the server changes to file `emails.yaml`, which is a yaml setting file.
### Usage:
Use **cron** to run this script periodically. First clone this project to your local directory. Make the `runner.py` executable by
```bash
chmod -x /path/to/runner.py
```Then edit the configuration of cron
```bash
crontab -e
```Add the following line:
```bash
*/5 * * * * /usr/bin/python /path/to/runner.py
```
Run the following command to make sure the task is reloaded:```bash
sudo service cron reload
```The logs of cron is included in `/var/log/syslog`. You can list those logo infomation using:
``bash
sudo grep CRON /var/log/syslog
```