AW: setting hostname manually?

Thomas Wuppermann tw at hbt.de
Tue Feb 7 14:51:49 CET 2006



> Thomas Wuppermann wrote:
> 
> > Question:
> > I There a way to tell FAI the hostname of the client to 
> install (reverse DNS isn't configured)? perhaps interactively?
> 
> Yes, I do this with a menu which I use to enter a static IP 
> address and 
> hostname to the client. It was discussed on this list a while 
> ago, but 
> it works like this:
> 
> in ./class I have a file 01menu:
> 
> -----------------------------------------------------------
> /tmp/ip
>      dialog --title "FAI (Fully Automatic Installation)" \
>      --menu "Choose the type of installation:" 15 64 6 \
>      SCOREBOARD "Scoreboard Plasma Controller" \
>      SCORING "Judges scoring control laptops" \
>      2>$tmp 1>/dev/console
> 
>     clear
> 
>     # define the new class
>     catnc `cat $tmp`
>      rm -f $tmp
> 
>      dialog --title "FAI" --inputbox "Input desired hostname:" 10 30 
> 2>$tmphostname 1>/dev/console
>      clear
>          hostname -F $tmphostname
> 
>          dialog --title "FAI" --inputbox "Input desired IP 
> Address:" 10 
> 30 2>$ip 1>/dev/console
>      clear
> -----------------------------------------------------------
> 
> 
> Then I have <CLASSNAME>.VAR:
> -----------------------------------------------------------
> HOSTNAME=`catnc /tmp/hostname`
> IPADDR=`catnc /tmp/ip`
> -----------------------------------------------------------
> 
> And it just works.
> 
> Ben.

Tanks Ben, 

That's a very helpful hint, I have introduced the dialog-script and almost everything went well ..... but ;-)
I'm defining classes depending on the hostname of the fai-client and when <CLASSNAME>.var is executed, the classes are already definded.

In my case the class before LAST is something like "10" (the beginning of the ip of the client).
So what I couldn't find is how to set $HOSTNAME before the hostclass and LAST are definded.

Thanks for any suggestions

Thomas



More information about the linux-fai mailing list