[luau] Re: Gnome doesn't load at bootup
Ray Strode
halfline at hawaii.rr.com
Thu Mar 21 13:59:41 PST 2002
Dean Fujioka wrote:
>>hostname ""
>>
>>echo '/bin/ipcalc --silent --hostname $(/sbin/ifconfig eth0 | sed -n -e
>>"s/^.*addr://g" -n -e "s/ Bcast.*//p")' >> /etc/sysconfig/network
>>
>>/etc/init.d/network restart
>>
>Is there a way I can save my settings first before I run this?
>
well you could backup the file.
cp /etc/sysconfig/network /etc/sysconfig/network.save
>Also could
>you explain what this does
>
Sure.
>hostname ""
>will set my host name to null
>
yes. It unsets your hostname.
>I looked at the man page for ipcalc. That seems to return network values.
>
Given an ip address, ipcalc can tell you the hostname name associated
with it.
It's output is of the form HOSTNAME="the.host.name"
>I don't know what the $( is for,
>
"Run the command within the $( ) and and substitute the $(...) on the
line with
the command's output"
For instance
echo "foo"
outputs "foo"
so
echo $(echo "foo")
would first run the echo "foo" within the $()
and then it would replace the $(...) with echo's output
which is foo, so the whole command would output foo.
It's equivalent to backticks if you've used those before.
>ifconfig returns information about network interfaces, but what does the |
>sed do?
>
sed -n -e s/^.*addr://g" -n -e "s/ Bcast.*//p
reads,
"substitue everything before the word addr: with the empty string (delete it) and
then substitute everything after the word " Bcast" with the empty string (delete it),
and then print whats left.
I'm just yankning your ip address from ifconfigs output.
>It all then seems to be put into a file /etc/sysconfig/network
>
Yes, I'm taking your current /etc/sysconfig/network file and i'm
appending to it a command that will set HOSTNAME="blah" where blah is
hostname your isp has associated with your ip address. Then when you
restart networking, the networking scripts will see that the hostname
value is "blah" and it will run hostname "blah" (among other things).
That should fix your problem, but it's kinda a hack. If it works then
I'll probably end up having you manually edit your
/etc/sysconfig/network file with a text editor. Something's fishy with
it I think.
--Ray
More information about the LUAU
mailing list