[bglug] IP dinamico vs IP statico

Paolo Asperti paolo@asperti.com
Gio 16 Dic 2004 22:15:08 CET


On Thu, 16 Dec 2004 10:08:43 +0100
"Koan" <bglug@koansoftware.com> wrote:
> # copia in coda al file "ipaddress.html" la riga che contiene l'indirizzo ip
> echo `wget -q -O - http://ipid.shat.net/iponly | grep ^[0-9]` >>ipaddress.html

Grazie, ho fatto un piccolo update al mio script che avevo scritto all'uopo.
Posto la versione attuale


--

#!/bin/sh

FTP_SERVER="ftp.example.com"
FTP_USERNAME="johndoe"
FTP_PASSWORD="s3cr37"

TMPFILE=`tempfile 2>/dev/null` || TMPFILE=/tmp/test$$
trap "rm -f $TMPFILE" 0 1 2 5 15
IPADDR=`wget -q -O - http://ipid.shat.net/iponly | grep ^[0-9]`

echo "Setting IP address: $IPADDR"

echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">" >>$TMPFILE
echo "<html><head>" >>$TMPFILE
echo "<meta http-equiv=\"refresh\" content=\"0;URL=http://$IPADDR/\">" >>$TMPFILE
echo "</head></html>" >>$TMPFILE

echo "File created"

echo "open $FTP_SERVER 
     user $FTP_USERNAME $FTP_PASSWORD 
     cd / 
     delete indexa.html 
     send $TMPFILE indexa.html 
     quit" | ftp -pin



-- 

 - AxP - 
 
Linux user n.241668
GPG key ID: 0C96DE3C
Key fingerprint = 21CC 3510 26A3 1FE3 DD20  1211 6993 690A 0C96 DE3C

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GIT/CS d++ s-: a- C++$ UL++B+H P+ L+++>$ !E---- W+ N+
o K w--- O- M- V-- PS PE+ Y+ PGP++>+++ t+ 5?
X+++ R !tv b+ DI? D+++ G++ e+ h+ r+++ y+++++**
------END GEEK CODE BLOCK------




Maggiori informazioni sulla lista bglug