Mailing List ArchiveSupport open source code!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]tlug: another ip-up script
- To: tlug@example.com
- Subject: tlug: another ip-up script
- From: Kei Furuuchi <kfur@example.com>
- Date: Mon, 3 Aug 1998 23:28:13 +0900 (JST)
- Content-Transfer-Encoding: 7bit
- Content-Type: text/plain; charset=us-ascii
- Reply-To: tlug@example.com
- Sender: owner-tlug@example.com
Since I found that "dig -x xxx.xxx.xxx.xxx" does not always answer PTR infomation, the following is the one which does not use dig. >> #!/usr/bin/perl >> require 'sys/socket.ph'; >> my $name, $rest,$first ,$localip, $date; >> shift; >> shift; >> $localip=shift; >> $name = pack('C4',split(/\./, $localip)); >> ($name,$rest) = gethostbyaddr($name,&AF_INET); >> $first = $name; >> $first =~ s/([^\.]+\.[^\.]+\.[^\.]+).*/$1/; >> if(open(FILE,"date |")) { >> while(<FILE>) { >> chop; >> $date = $_; >> } >> close(FILE); >> } >> >> if($name) { >> if(open(FILE,">>/etc/hosts")) { >> print FILE "$localip $name $first # $date\n"; >> close(FILE); >> system "hostname $first"; >> } >> } -------------------------------------------------------------- Next Meeting: 8 August, Tokyo Station Yaesu central gate 12:30 featuring Linux on multiple platforms: i386, Sparc, PA-Risc, Amiga, SGI, Alpha, PalmPilot, ... Next Nomikai: 18 September, 19:30 Tengu TokyoEkiMae 03-3275-3691 -------------------------------------------------------------- Sponsor: PHT, makers of TurboLinux http://www.pht.co.jp
- Follow-Ups:
- Re: tlug: another ip-up script
- From: Jim Tittsler <jwt-tlug@example.com>
Home | Main Index | Thread Index
- Prev by Date: tlug: Strange headers from TLUG server?
- Next by Date: Re: tlug: Call for Volunteers
- Prev by thread: Re: tlug: Strange headers from TLUG server?
- Next by thread: Re: tlug: another ip-up script
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links