Extracting variables from within ks.cfg, interpreted from command-line

Shabazian, Chip Chip.Shabazian at bankofamerica.com
Wed Mar 15 17:22:30 UTC 2006


This is what I use in my command section:
%include /tmp/partinfo

And this is in my %pre:
ETH=`grep DEVICE /tmp/netinfo | cut -d = -f 2`
IP=`ifconfig $ETH | grep inet | cut -d : -f 2 | cut -d " " -f 1`
NETMASK=`ifconfig $ETH | grep inet | cut -d : -f 4`
GATEWAY=`route -n| grep "^0.0.0.0" | cut -b 17-32 | cut -d " " -f 1`
HOSTNAME=`grep HOSTNAME /tmp/netinfo | cut -d = -f 2 | cut -d . -f 1`

cat << EOF > /tmp/buildnet
network --device $ETH --bootproto static --ip=$IP --netmask=$NETMASK
--gateway=$
GATEWAY --hostname=$HOSTNAME
EOF

This works every time, whether you get your IP address from DHCP, or
specify it on the command line.

Chip 

-----Original Message-----
From: kickstart-list-bounces at redhat.com
[mailto:kickstart-list-bounces at redhat.com] On Behalf Of Philip Rowlands
Sent: Tuesday, March 14, 2006 11:21 PM
To: Discussion list about Kickstart
Subject: Re: Extracting variables from within ks.cfg, interpreted from
command-line

On Tue, 14 Mar 2006, Dan Trainor wrote:

> Alright, so, I think something wierd is going on.
>
> I'm still seeing Anaconda bomb out saying that /tmp/netsettings does 
> not exist.  I can verify that /tmp/netsettings does not get created.
> However, I cannot figure out why.
>
> vty3 tells me something similar to the following:
>
> :  command not founde 1:
> :  command not founde 3:
> :  command not founde 6:
[snip]

This doesn't quite feel like CRLF-line-endings, but worth a check. Can
you post your kickstart file?


Cheers,
Phil

_______________________________________________
Kickstart-list mailing list
Kickstart-list at redhat.com
https://www.redhat.com/mailman/listinfo/kickstart-list




More information about the Kickstart-list mailing list