Networking Forums

Networking Forums > Computer Networking > Linux Networking > Can I use /etc/dhclient-exit-hooks to run an IP updater?

Reply
Thread Tools Display Modes

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

 
 
Ohmster
Guest
Posts: n/a

 
      09-17-2006, 06:43 PM
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
 
Reply With Quote
 
 
 
Reply

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Query regarding netfilter hooks sanjay Linux Networking 1 03-04-2008 05:54 PM
Dynamic IP Updater, please help decipher mistake on web page instructions Ohmster Linux Networking 0 09-17-2006 08:25 AM
modification of tcp flags using netfilter hooks?? Sunny Linux Networking 1 02-09-2006 08:13 AM
CIFS/SMB hooks or implementation Dave Williams Windows Networking 0 02-18-2005 01:29 PM
using netfilter hooks in LKM's threadhead Linux Networking 0 08-15-2003 06:05 PM



1 2 3 4 5 6 7 8 9 10 11