Public network IP detection (python)

Source: Internet
Author: User

The shell version of See http://my.oschina.net/firxiao/blog/349727

The Project address: https://github.com/Firxiao/check_public_ip

How to use:

git clone https://github.com/Firxiao/check_public_ip.gitcd check_public_ipchmod +x CHECK_PUBLIC_IP.PYCP Conf.ini.example Conf.ini

Change the configuration file

Change the mailbox configuration to the right

VI Conf.ini#url can return your public IP Address[url]url = http://ifconfig.me[mail_server]smtp_server = smtp.example.com Mail_user = Usermail_pass = Passwordmail_postfix = Example.com[user] Mailto_list = ["[Email protected]", "[email protected ]"]


After the configuration is done

./check_public_ip.py

The first execution will record the current public IP address into the public_ip.txt of the current directory and will not send an email alert

Test email can be emptied and executed Public_ip.txt

Can be added to Crontab

*/5 * * * */opt/check_public_ip/check_public_ip.py >/dev/null 2>&1


Public network IP detection (python)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.