1: #!/usr/bin/perl -w 2: 3: #run this from /etc/rc.d/rc.local to have your ip posted 4: #to the net somewhere, so that when you start a machine, you 5: #know where it is on the net. 6: #comments, and suggestions are welcome. 7: 8: use strict; 9: use Net::FTP; 10: 11: my $server="someserver.com"; 12: my $user="username"; 13: my $password="notarealpassword"; 14: my $dir="www"; 15: my $file="/tmp/ipinfo"; 16: 17: my $ftp; 18: 19: `ifconfig > /tmp/ipinfo`; 20: 21: $ftp=Net::FTP->new($server); 22: $ftp->login($user, $password); 23: $ftp->cwd($dir); 24: $ftp->put($file); 25: $ftp->quit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Simple IP Poster
by dws (Chancellor) on Feb 27, 2001 at 13:26 UTC | |
by coolmichael (Deacon) on Feb 27, 2001 at 13:49 UTC | |
by tomhukins (Curate) on Feb 27, 2001 at 20:08 UTC | |
by tadman (Prior) on Feb 28, 2001 at 05:55 UTC | |
|
Re: Simple IP Poster
by Hero Zzyzzx (Curate) on Mar 13, 2001 at 04:01 UTC |