Re: Auto-notify remote user of IP address change?
On Tue, 08 Mar 2005 06:59:33 +1000, David Powell
<moondrake@optusnet.com.au> wrote:
> Hi All,
>
> Sorry if this has been asked and answered.
>
> I'm installing a DB server into a clients office, and I want to be able
> to set up remote ssh access to the box from home.
>
> The glitch is that the client's ADSL internet access has a dynamic IP
> address. I wondered if anyone knew of any good ways that I can get the
> debian box (which will be the DB server - and the only one I've access
> to) to check what IP address the office gets, and automatically e-mail
> me (or something) when it changes?
>
> The full setup for the office is:
>
> Internet
> |
> |
> Modem/Router
> |
> / \
> / \
> / \
> Debian Windows
> Server desktops
>
> My setup at home is similar (though I've got linux desktops) and I I've
> tried to get the IP address that the modem is assigned, but the only way
> I've been able to is by visiting internet sites (like shields up) that
> report that info back.
>
> Any clues greatly appreciated.
>
> Cheers,
>
> David
>
> --
> David Powell
> Information Systems Developer
> Moondrake Trust
> e: moondrake at optusnet dot com dot au
>
I've made cronjob wich more or less does this, but it requieres you
have SSH access to your home PC. But anyway, here it is:
Put this line in to your .bashrc file:
'alias myip="/sbin/ifconfig eth0 | grep 'inet add' | awk '{print
$2}' |cut -d '' -f 12 |cut -d: -f2" '
Set up a cronjob maybe like this:
* * * * * * date>>myip.text; myip>>myip.text; scp myip.text your.name@host:
Cheers, Vegard
Reply to: