hostname issue


Forum: HD Install
Topic: hostname issue
started by: aldar

Posted by aldar on Oct. 03 2007,18:29
I have this DSL install setup the way I want it, but for some reason it is ignoring the "host=test" setting in my grub line. Here is what I have:

kernel /boot/linux24 root=/dev/hda1 quiet vga=normal noscsi no pcmcia nodhcp nousb frugal host=TEST
(I have also tried the above w/o frugal)

What I'd really like is to make ONE file contain the hostname, ip, gw, mask, and dns so that a non-linux person will only have to modify ONE file to change those settings instead of them have to change several.

Currently I have a file that changes all the above settings EXCEPT the hostname which is run after dsl auto-login.

Any suggestions on how I can get all those settings in to one file so a non-linux user can make those changes in just one place easily and then I can just create a small script to bounce the eth0 to put the new settings into effect? Any suggestions would be greatly appreciated. Thanks.

Posted by chaostic on Oct. 03 2007,22:21
Quote (aldar @ Oct. 03 2007,14:29)

Traditional Install? I think there are 3 places you need to change to get the hostname to work right (but I'm going on experiece with old versions).

But about the info in one place, you can either make the script hold the info, commented so the user opens up the script and changes the variables, or have the script read a file with the variable names.

i.e.
variablefilename:
hostname=??
ip=??
etc

then
scriptname:
#/bin/sh
$hostvar= [cat ~/variablefilename | grep hostname= | awk hostname] ;
echo $hostvar >> /etc/hostname

Obviously, thats all psuedocode. I don't know how to use awk or remember correct bash shell script commands. So instead of a 2 line script to restart eth0, you have a 15~20 line script doing everything.

Posted by curaga on Oct. 04 2007,14:29
For just a file that defines variables, using cat, grep and awk would make it Bloated!

Just source the file:
Quote
#!/bin/sh
. myconfigfile
hostname $hostname
etc etc

Posted by roberts on Oct. 04 2007,15:54
Some boot options are only supported for live CD or emulations thereof, i.e, poormans & frugal. The reason for this is becase on a traditional hard drive install you would typically perform these tasks only once and not upon every boot.

For traditional hard drive install, use traditional methods.
There is a script in /etc/init.d/sethostname

With the boot option in grub, (host boot option set), you should only have to call this script once to set the host name.

Powered by Ikonboard 3.1.2a
Ikonboard © 2001 Jarvis Entertainment Group, Inc.