On Mon, 10 Feb 2003 12:36:57 -0500 (EST) Net Llama! <[EMAIL PROTECTED]> wrote:
[snip]
> > To answer your question, though, it is possible during boot to
> > modify the contents of system reference files (/etc/hosts,
> > /etc/resolv.conf, etc.). DHCPCD changes /etc/resolv.conf for one.
>
> What i'm trying to do is put something like this in (for example)
> /etc/hosts:
> $IPADDR $HOSTNAME
>
> and then set $IPADDR=192.168.0.3 and $HOSTNAME=foo.bar.com
>
> is this possible?
Sure, you can put that just like you have it. But it won't work, and
will cause you all kinds of trouble.
Remember all those daemons running on your system? Some of them need
the information provided by these files and these daemons have no
"environment". So where will they get the right info from?
Since the info doesn't change, I suggest you get the address and name
during bootup and put the correct info in the file.
Using DHCP? OK, after you have initialized the interface and obtained
an answer from dhcp, run a script against the output of ifconfig. Then
run a DNS query against the IP to get the hostname and put all that into
/etc/hosts. After all, this info shouldn't normally be dynamic between
reboots (or is this a laptop that's never shut off?).
Ciao,
David A. Bandel
--
Focus on the dream, not the competition.
Nemesis Racing Team motto
msg12023/pgp00000.pgp
Description: PGP signature
_______________________________________________ Linux-users mailing list [EMAIL PROTECTED] Unsubscribe/Suspend/Etc -> http://www.linux-sxs.org/mailman/listinfo/linux-users
