[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

RE: Enviar IP Dinamica a correo



> Hola de nuevo,hoy me estoy inchando a escribir post ;-)
> Bueno mi nueva consulata es para poder saber en cada momento que Ip 
> tiene mi Pc ya que tengo una conexion con ip dinamica, creo que existia 
> alguna aplicacion que te podia mandar por correo electronico la ip que 
> tenias cada X tiempo.
> Alguien sabe como se llama?? me podeis decir como se utiliza mas o 
> menos, y si el servicio seria gratutito???
> Muchas Gracias.
> 
> Un saludo.
> 
> 
Ahí va eso:
Inicializa /etc/mi_ip adecuadamente y mete esto en un .sh

#!/bin/bash

FICHERO_CONF=/etc/mi_ip
IP_ANTIGUA=`cat $FICHERO_CONF`
TIEMPO_A_DORMIR=300

while [ 1 == 1 ]
do
MIIP=`who am i | awk '/./ {gsub(".*\(","");gsub("\).*",""); print}'`
IP_ACTUAL=`hostname --ip-address $MIIP`

if [ $IP_ANTIGUA != $IP_ACTUAL ]
then
  /usr/sbin/sendmail direccion@decorreo.es << quit
LA IP HA CAMBIADO. NUEVA IP: $IP_ACTUAL
quit
echo $IP_ACTUAL > $FICHERO_CONF
IP_ANTIGUA=$IP_ACTUAL
fi
sleep $TIEMPO_A_DORMIR
done



	Cuela el script en el arranque de tu máquina y dejalo corriendo en
background, tendrás un chequeo cada 5 minutos por si hay cambios en
caliente... lo he probado y funciona. Un saludo.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------------------------
La información contenida en este correo electrónico es privada y
confidencial. Cualquier uso, modificación, difusión y/o reproducción por
parte de cualquier persona distinta del destinatario está prohibida. Si Vd.
recibe este mensaje por error, por favor bórrelo y comuníquelo al remitente.
----------------------------------------------------------------------------
----------------------------------------------------------------------------
------------------------------------

This e-mail and any attachments are confidential and intended solely
for the addressee and may also be privileged or exempt from disclosure
under applicable law. If you are not the addressee, or have received
this e-mail in error, please notify the sender immediately, delete it
from your system and do not copy, disclose or otherwise act upon any
part of this e-mail or its attachments..

Internet communications are not guaranteed to be secure or virus-free.
The Barclays Group does not accept responsibility for any loss arising
from unauthorised access to, or interference with, any Internet
communications by any third party, or from the transmission of any
viruses. Replies to this e-mail may be monitored by the Barclays
Group for operational or business reasons..

Any opinion or other information in this e-mail or its attachments
that does not relate to the business of the Barclays Group is personal
to the sender and is not given or endorsed by the Barclays Group.

Barclays Bank PLC.Registered in England and Wales (registered no. 1026167).
Registered Office: 1 Churchill Place, London, E14 5HP, United Kingdom.

Barclays Bank PLC is authorised and regulated by the Financial Services Authority.



Reply to: