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

Dan Trainor dan at id-confirm.com
Mon Mar 27 18:19:21 UTC 2006


Hi, Chip -

Because I'm anal.

I don't want to use Anaconda's naming conventions for the components.  I 
wanted to use something that comforms closer to our system as a whole, 
i.e. ip= would become MYAPPIPADDR=, stuff like that.

Just wanted to let you know that, so you don't think I'm nuts, and you 
knew where I was going with that haha.

Thanks!
-dant

Shabazian, Chip wrote:
> That works just as well, but I'm not sure why you would be having problems with my original line.  It works perfect for me, and hasn't failed in over 1000 builds. 
> 
> -----Original Message-----
> From: kickstart-list-bounces at redhat.com [mailto:kickstart-list-bounces at redhat.com] On Behalf Of Edwind Richzendy Contreras Soto
> Sent: Sunday, March 26, 2006 6:59 PM
> To: Discussion list about Kickstart
> Subject: RE: Extracting variables from within ks.cfg, interpreted from command-line
> 
> in this line: IP=ifconfig $ETH | grep inet | cut -d : -f 2 | cut -d " "\ -f 1
> 
> change for: IP=ifconfig $ETH | grep "inet addr" | awk '1{print $2,$5 }'\
> | awk -F :  '1{print $2 }'
> 
> the result is = in both lines :D
> 
> El mié, 15-03-2006 a las 09:22 -0800, Shabazian, Chip escribió:
>> 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
>>
>> _______________________________________________
>> Kickstart-list mailing list
>> Kickstart-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/kickstart-list
> --
> Fingerprint: 43C5 2F43 1238 D72C BAA1 F9D7 CECE E171 FBF8 5909
> 
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list at redhat.com
> https://www.redhat.com/mailman/listinfo/kickstart-list
> 


-- 
- Dan Trainor
- id-Confirm, Inc.
- Direct:  720.241.5580




More information about the Kickstart-list mailing list