[ninux-not-wireless] ADSL e IP dinamico

Alessandro Gubitosi gubi.ale at gotanotherway.com
Sat Apr 13 13:59:20 CEST 2013


E poi dicono che il gruppo software non esiste-non funziona...
Queste sono cose degne da wiki :)
Grande grazie

Il 12/04/2013 11:29, Alessandro (aka ArkaNet) ha scritto:
> Capita spesso a chi possiede una semplice linea adsl con IP dinamico
> di vedere il proprio IP cambiare frequentemente
> ecco un semplice script per tenerne traccia
>
> -----------------------------------------------------------[CUT
> ME]-----------------------------------------------------------
>
> #!/bin/bash
> #
> # EASY IP LOGGER
> #
> mkdir /var/log/IP_CHECK
> touch /var/log/IP_CHECK/ip.log
> DIR="/var/log/IP_CHECK/ip.log"
>
> while true; do
> echo -e "\n#################### [$(date +"\033[01;32m%F\033[00m
> \033[01;31m%T\033[00m")] ######################" >> $DIR
> test_ping=$(ping -c 3 www.google.com <http://www.google.com> | while
> read pong; do echo -e "[$(date +"\033[01;32m%F\033[00m
> \033[01;31m%T\033[00m")] ${pong}"; done)
> test_ip=$(curl -s checkip.dyndns.com <http://checkip.dyndns.com> | awk
> ' BEGIN { FS = ": " } ; {print $2} ' | cut -d '<' -f1 | while read ip;
> do echo -e "[$(date +"\033[01;32m%F\033[00m \033[01;31m%T\033[00m")]
> ${ip}"; done)
> echo -e "${test_ping}\n" >> $DIR
> echo "${test_ip}" >> $DIR
> echo -e
> "#################################################################\n"
> >> $DIR
> sleep 60
> done
> exit 0
>
> -----------------------------------------------------------[CUT
> ME]-----------------------------------------------------------
>
>
> -- 
> /Arka
> /
>
>
> _______________________________________________
> Not-wireless mailing list
> Not-wireless at ml.ninux.org
> http://ml.ninux.org/mailman/listinfo/not-wireless
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ml.ninux.org/pipermail/not-wireless/attachments/20130413/85921728/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 554 bytes
Desc: OpenPGP digital signature
URL: <http://ml.ninux.org/pipermail/not-wireless/attachments/20130413/85921728/attachment-0001.sig>


More information about the Not-wireless mailing list