<kbd id='rvVNkTpR8ytr4j5'></kbd><address id='rvVNkTpR8ytr4j5'><style id='rvVNkTpR8ytr4j5'></style></address><button id='rvVNkTpR8ytr4j5'></button>

              <kbd id='rvVNkTpR8ytr4j5'></kbd><address id='rvVNkTpR8ytr4j5'><style id='rvVNkTpR8ytr4j5'></style></address><button id='rvVNkTpR8ytr4j5'></button>

                      <kbd id='rvVNkTpR8ytr4j5'></kbd><address id='rvVNkTpR8ytr4j5'><style id='rvVNkTpR8ytr4j5'></style></address><button id='rvVNkTpR8ytr4j5'></button>

                              <kbd id='rvVNkTpR8ytr4j5'></kbd><address id='rvVNkTpR8ytr4j5'><style id='rvVNkTpR8ytr4j5'></style></address><button id='rvVNkTpR8ytr4j5'></button>

                                  申博娱乐官网_怎样会见具有动态ip的Linux处事器

                                  作者:申博娱乐官网  发布时间:2018-02-03 19:07  阅读:8168

                                  通用的要领可以回收花生壳(不外不保举这些海内域名注册商,这些注册商随意及可以遏制理会你的域名而不讲法令,到时你想哭也来不急。),假如认为贫困,,不妨用下面这个剧本,然后用crontab让它每个10分钟执行一次,假如ip产生变革了,便向你指定的邮箱发送一封包括更新了的ip的邮件。

                                  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 = 'To: 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/n";
                                      print SENDMAIL "Hi, the public ip at home is changed to $new_pub_ip.";
                                      close(SENDMAIL);

                                  system("logger /"public ip updated/"");
                                  }
                                  else
                                  {
                                      system("logger /"public ip unchanged/"");
                                  }