Re: Bit Twister: Is this the dhclient-exit-hooks you were talking about?



Bit Twister <BitTwister@xxxxxxxxxxxxxxxx> wrote in
news:slrneh95ko.co6.BitTwister@xxxxxxxxxxxxxxx:

Okay I am back to xnews, it is much easier for me to use than slrn.

#************* end /etc/dhclient-exit-hooks **************************


I want my hostname to be ohmster.com so will this script not allow me
to do that?

You change the script to do what you want it to do.

Where can I instert my wgets call to bring up my wgets text file
to update my domain IP addresses?


if [ $exit_status -eq 0 ] ; then
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then

-------- Your code here. ------
fi
fi

Or new and improved

if [ $exit_status -eq 0 ] ; then
case $reason in
BOUND|RENEW|REBIND|REBOOT)

-------- Your code here. ------

esac
fi

Hey bit, I see what you are saying for me to insert my own code, like to
change my domain's IP addresses at the DNS server and to restart my
firewall, but what you show here would pretty much bypass everything you
have written about your gateway changes, your postfix updates, and your
firewall updating. Granted I do not use postfix or shorewall, so you are
saying to just use this tiny bit of script and then put whatever I want
in between the two lines? i.e.: This is the entire script?

---------------------------------------------------------------------
if [ $exit_status -eq 0 ] ; then
case $reason in
BOUND|RENEW|REBIND|REBOOT)

-------- Your code here. ------

esac
fi
---------------------------------------------------------------------

Just that little bit is all I need for an entire dhclient-exit-hooks
file? Are there any support files that are necessary to go with this such
as the /sbin/dhclient-script? This is the dhclient-script I have for
that:

#!/bin/bash
# dhclient-script for Linux. Dan Halbert, March, 1997.
# Updated for Linux 2.[12] by Brian J. Murrell, January 1999.
# No guarantees about this. I'm a novice at the details of Linux
# networking....

I have not script writing talent like you have. If I try to write my own
script using the piece of code that you gave me above between the lines,
will you help me to proof it to make sure it will work? What I need is
for the script to do is to update my domains on the DNS server with my
wgets and then restart my firewall. The firewall has to actually start
when a connection is made, and then restart if the connection has
changed. These two actions are separate and require different lines of
code, i.e.:

To start firewall initially:
sh /etc/firestarter/firestarter.sh start

To restart a running firewall:
/etc/init.d/firestarter restart

How do I make the script choose the correct action? When the computer
boots, I need the initial start line. When I get an IP address change,
then I need the restart line.

What is this script for, where did it come from?

That script used to change the ip address in /etc/hosts file
setting my ISP gateway in /network and changing values
in /etc/shorewall/params file.
The params file is read by the firewall manager shorewall.

Out of my head.

Holy crap, out of your head. You are a good man, Charlie Brown. :)

Thanks for all of the fantastic help bit.
--
~Ohmster
theohmster at comcast dot net
Put "messageforohmster" in message body
to pass my spam filter.
.



Relevant Pages

  • Re: Linux Firewall
    ... Does the following firewall script make sense to you guys(it seems to ... I have only recently migrated to Linux (Suse) from M$ XP Pro. ...
    (comp.os.linux.security)
  • help again please
    ... I would like to implement iptables as my firewall. ... i have an adsl modem which is currently attached to a windows ... The file server is another linux box. ... I am looking at implementing the script above. ...
    (comp.os.linux.security)
  • Re: Best Linux Firewall?
    ... > with a NAT script and basic firewall. ... > my Linux router to its knees at the kernel level and rendered a workstation ... I had an NFS share with Red Hat 6.2, and I think it was that. ...
    (alt.os.linux)
  • Re: iptables restart hangs
    ... | option set, "iptables restart" will still flush all rules, set default ... And you can't use "iptables ... | to save fw rules before stopping the firewall). ... something should be added to the restart script. ...
    (Fedora)
  • Re: Firewall choices
    ... I've used firestarter and occasional ... most of what you find regarding firewalls in Linux will just ... be wrappers and scripts for the Linux built-in firewall, ... Perhaps you could write a script that would do it. ...
    (alt.os.linux)