IP -> e-mail
Robert Huff
roberthuff at rcn.com
Wed Jun 6 13:17:52 UTC 2012
Matthias Apitz writes:
> > Let say my computer is connected to the internet with a cable
> modem and has a dynamic IP address via DHCP. This address is
> refreshed after every random days.
>
> > I want to know the new address even when I'm not home. Like
> send an e-mail with the new IP, I already know how to do this,
> but how can I track the event when my computer receives the new
> IP?
>
> Run this in a cronjob:
>
> lynx -dump myip.nl | fgrep 'WAN IP'
>
> strore the result in a file and when it changes, trigger a mail;
Or, using only tools in the base system:
ifconfig | head | grep "inet " | awk '{print $2}'
Robert Huff
More information about the freebsd-questions
mailing list