Complete.Org: Mailing Lists: Archives: discussion: November 1999:
[aclug-L] Re: FTP Script
Home

[aclug-L] Re: FTP Script

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: aclug-L@xxxxxxxxxxxx
Subject: [aclug-L] Re: FTP Script
From: Dale W Hodge <dwh@xxxxxxxx>
Date: Sat, 20 Nov 1999 19:42:48 -0600 (CST)
Reply-to: aclug-L@xxxxxxxxxxxx

On Sat, 20 Nov 1999, Curtis Hawthorne wrote:

> I need to write a script to upload my current IP address to an FTP server 
> every time that I connect.  How would I do this?  Is there an FTP program I 
> could write a script for?
> 
> Thanks!
> 
> Curtis H.
> 

Here's a script I previously used that ran from ip-up.  It greps 
ifconfig for the network address, knowing that the first two quads are
always the same. It then uses sed to manipulate the output from grep into
just the ip address.  Then it uses ncftput to place the address in my
.plan  file on my ISP.  Further, I pass the .plan through txt2html to 
make an html file that is finally uploaded to my public directory
on my ISP.

Please note that the 2nd line startes with /sbin/ifconfig and the third
with sleep 2s. If your's looks differently, it's because your mail 
reader has wrapped the rather long line.  

**************************

#!/bin/sh
/sbin/ifconfig | grep 206.53 | sed -e 's|inet addr:|http://|' -e 's|P.*||' -e 
's|M.*||' > /etc/diald/.plan
sleep 2s
ncftpput -f /etc/diald/sktc.cfg . /etc/diald/.plan
/usr/local/txt2html/txt2html.pl /etc/diald/.plan > /etc/diald/myip.html
sleep 5s
ncftpput -f /etc/diald/sktc.cfg ./public_html /etc/diald/myip.html

**************************

--dwh 

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -   
Dale W Hodge  *  dwh@xxxxxxxxxxxxxxxx * dwh@xxxxxxxx * dwh@xxxxxxxxxxxxxxxxxx
             -- www.neuralmatrix.org * www.dnd-automotive.com -- 
         -= Visit the Aclug Companion http://aclug.neuralmatrix.org =-  
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



[Prev in Thread] Current Thread [Next in Thread]