The general method can use peanut shells (but we do not recommend these domestic domain name registrars, these registrars can at will and can stop parsing your domain name without talking about the law, then you want to cry also don't rush .), If you are in trouble, use the following script and use crontab to execute it every 10 minutes. If the ip address changes, you can send
The general method can use peanut shells (but we do not recommend these domestic domain name registrars, these registrars can at will and can stop parsing your domain name without talking about the law, then you want to cry also don't rush .), If you are in trouble, use the following script and then useCrontabRun the command once every 10 minutes. If the ip address changes, an email containing the updated ip address is sent to your specified email address.
Ipsender
----------------------------------------------
#! /Usr/bin/perl
Use LWP: Simple;
Use sTrIct;
My $ pub_ip _File= '/Etc/ipsender/mypubip ';
My $ old_pub_ip ='Cat$ Pub_ip_file ';
Chomp ($ old_pub_ip );
My $ new_pub_ip = get ('HTTP: // whatismyip.org ');
Chomp ($ new_pub_ip );
If ($ new_pub_ip ne "" & $ new_pub_ip ne $ old_pub_ip)
{
Open (IPFILE, "> $ pub_ip_file") | die "cannot open $ pub_ip_file: $! ";
Print IPFILE $ new_pub_ip;
Close (IPFILE );
My $ sendmail = "/usr/sbin/sendmail-t ";
My $ sendto = 'a: your@mailbox.com ';
My $SuBject = 'subject: pubIP @ home ';
Open (SENDMAIL, "| $ sendmail") or die "Cannot open $ sendmail: $! ";
Print SENDMAIL $ sendto. "/n ";
Print SENDMAIL $ subject. "/n ";
Print SENDMAIL "Content-type: tExT/html/n ";
Print SENDMAIL "Hi, the public ip at home is changEdTo $ new_pub_ip .";
Close (SENDMAIL );
System ("logger/" public ip upDateD /"");
}
ELsE
{
System ("logger/" public ip uNcHanged /"");
}