Networking Forums  

Go Back   Networking Forums > Networking Newsgroups > Linux Networking

Can I use /etc/dhclient-exit-hooks to run an IP updater?

Reply
 
Thread Tools Display Modes
  #1  
Old 09-17-2006, 07:43 PM
Default Can I use /etc/dhclient-exit-hooks to run an IP updater?



I am getting closer to what I need and am almost there. Running Fedora
Core 3 with 3 FQDNs, free DNS provided by zoneedit.com. Have cablemodem
connection provided by Comcast and use dhcp to get my network configured
at boot time with dynamic IP address. Have external Scientific Atlanta
Webstar Ethernet cablemodem.

I need to update my zoneedit DNS of my correct IP address when it
changes. I have a wget command for each of the three domains that I need
to run when IP address changes:

They are one-liners
---------------------------------------------------------------------
wget -O - --http-user=username --http-passwd=password
'http://dynamic.zoneedit.com/auth/dynamic.html?host=www.mydomain1.com'

wget -O - --http-user=username --http-passwd=password
'http://dynamic.zoneedit.com/auth/dynamic.html?host=www.mydomain2.com'

wget -O - --http-user=username --http-passwd=password
'http://dynamic.zoneedit.com/auth/dynamic.html?host=www.mydomain3.com'
---------------------------------------------------------------------

Should I put these wget commands in a text file and make it executable?
Is there anything else that needs to go into this executable text file
like #!/bin/bash or anything like that or no, just put the commands, one
per line, in a regular executable text file?

I think that I can have these commands executed by /etc/dhclient-exit-
hooks as this file seems to execute whenever a dhcp connection is made
and I believe that is what happens when I get a new IP address from my
ISP. The contents of the file are:

[ohmster@ohmster etc]$ cat /etc/dhclient-exit-hooks
sh /etc/firestarter/firestarter.sh start
[ohmster@ohmster etc]$

And this is to restart my firewall when I get a new connecton. This is
what would have to happen anyway. So I have put my wget commands, one per
line, in a file called:
/home/ohmster/scripts/domain_IP_update
and made that file executable. I then tested it by running it:
/home/ohmster/scripts/domain_IP_update

All of this seemed to work very well. Now I want to make it run whenever
my IP address changes so I added it to this file:

[ohmster@ohmster etc]$ cat /etc/dhclient-exit-hooks
sh /etc/firestarter/firestarter.sh start
/home/ohmster/scripts/domain_IP_update
[ohmster@ohmster etc]$

The Question: Do you guys think that this will work?

Thanks.
--
~Ohmster


Ohmster
Reply With Quote
Reply

Tags
run, updater

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 07:04 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.