Extracting variables from within ks.cfg, interpreted from command-line
Edwind Richzendy Contreras Soto
richzendy at gmail.com
Mon Mar 27 02:59:08 UTC 2006
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20060326/c2c87cf4/attachment.sig>
More information about the Kickstart-list
mailing list