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

Pat <[email protected]>
Newsgroups gmane.linux.redhat.kickstart.general
Message-ID <[email protected]>
My kickstart file is usually used on systems with 1 or 2 network interfaces installed. If my kickstart file has the following lines:

network --device eth0 --bootproto dhcp
network --device eth1 --onboot no --bootproto dhcp


It will fail if I use it on a system with only 1 network interface since eth1 doesn't exist. 

>From a kicksstart file how do I detect the number of network interfaces installed on the system and then only assign eth1 as above if that number is 2 or more? If it matters, it's possible the network interfaces are not plugged into the network when the kickstart is run. Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.