Re: How to detect the number of network adapters installed from kickstart file for network config?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 23, 2011 at 03:03, Pat <patchu1@xxxxxxxxx> wrote:
> On Feb 19, 2011, at 6:57 PM, peter Sjoberg wrote:
>> Well, dunno about works but a simpler version at least
>> Task: if eth1 exist - configure it
>> Solution:
>>
>> #Top part:
>> #Always config eth0
>> network --device eth0 --bootproto dhcp
>> %include /tmp/optionalnetwork.inc
>>
>> %pre
>> #make sure the file is there to not cause any errors
>> touch /tmp/optionalnetwork.inc
>>
>> /sbin/ifconfig eth1 &>/dev/null && \
>>  echo "network --device eth1 --onboot no --bootproto dhcp"\
>>> /tmp/optionalnetwork.inc
>>
>> Or if ksbootenv ifconfig is different and doesn't fail if not found
>>
>> ifconfig -a|grep ^eth1 &>/dev/null && \
>>  echo "network --device eth1 --onboot no --bootproto dhcp"\
>>> /tmp/optionalnetwork.inc
>
>
> Thanks for all the replies and apologies for the non-threaded reply as I had subscribed to the digest version. I went with the solution above from Peter since it was simple and addressed my main need. I had to make one small correction, /sbin/ifconfig did not exist in the kickstart boot environment, it was actually at /usr/bin/ifconfig. So I removed the /sbin/ from the call to ifconfig after which it worked fine.
>
> Cheers,
> Pat


Nice with feedback.

And I think that Pete's solution was KISS and I love that design regime.

/Mats

/Mats

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



[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux