suggestion for dhcp hints

St.Purple purplehouse at hotmail.com
Fri Mar 22 07:33:41 PST 2002


Why not put just

source /etc/dhcpc/dhcpcd-$DEVICE.info
$IPADDR     neptune.greg.net        Neptune
in your hosts file.

This works for me.....

--
Greetz

¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´St. Purple`·.¸¸.·´¯`·.¸¸.·´¯`·.¸¸.·´¯`·.¸


There is but a thin line between coincedence and fate

"Gregory Davis" <gdavis7 at umbc.edu> wrote in message
news:a7deoi$riq$1 at shadowfax.linuxfromscratch.org...
> Hello there!  In the latest dhcp hint, the author has setup the hostname,
> but only makes a call to action for setting up the IP.  For instance,
after
> setting dhcp according to the hint, hostname -i returns garbage.  This is
> because the dynamically assigned IP is not included in the /etc/hosts
file.
>  I do not know if that will cause any problems, but I like to do things
all
> the way.  So I played with the ethnet init script and came up with these
> inclusions thereto, one for the bottom of the start) case, and the other
> for the bottom of the stop) case.  Of course, these include my domain
> names, but users should replace them with his or her own.  Also, these
> inclusions get the IP address from dhcp's info file (is this a security
> risk?) so it is concurrent with the dynamically assigned IP from the dhcp
> server.  These inclusions also prevent against runaway additions to the
> /etc/hosts file by checking for previous additions using grep.
>
> Greg
>
>
> ## begin start) inclusion
>         if [ -z "`cat /etc/hosts | /bin/grep "neptune.greg.net"`" ]
>         then
>                 source /etc/dhcpc/dhcpcd-$DEVICE.info
>                 echo "$IPADDR neptune.greg.net        Neptune" \
>                         | cat >> /etc/hosts
>         fi
>
>                 ;;
> ## end start) inclusion
>
> ## begin stop) inclusion
>         echo \
> "# Begin /etc/hosts (network card version)
>
> 127.0.0.1      localhost.localdomain   localhost
>
> #
> # below is dynamic IP address added by ethnet script
> #
>
> " \
>         | cat > /etc/hosts
> ## end stop) inclusion


-- 
Unsubscribe: send email to listar at linuxfromscratch.org
and put 'unsubscribe hints' in the subject header of the message



More information about the hints mailing list