On Setting Orange, the 44th day of Confusion, Paul Jakma croaked:
> grrrr.....
[snip]
> ls ifcfg* | egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | egrep -v
> '(~|\.bak)$' | egrep -v 'ifcfg-ippp[0-9]+$' | egrep
> 'ifcfg-[a-z0-9]+$' | sed 's/^ifcfg-//g'
>> (with /etc/sysconfig/network-scripts as PWD).
>> so how can i modify the sed so that it spits out any eth? interfaces
> before any remaining interfaces? (or any other suggestion as to how to
> quickly get this to spit out eth? before other interfaces).
Had a look at our (old) RH networking scripts ...
A quick job:
eth_interfaces=`ls ifcfg* | \
egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \
egrep -v '(~|\.bak)$' | egrep -v 'ifcfg-ippp[0-9]+$' | \
egrep 'ifcfg-[a-z0-9]+$' | sed 's/^ifcfg-//g' | egrep '^eth0'`
^^^^^^^^^^^^^^^^
non_eth_interfaces=`ls ifcfg* | \
egrep -v '(ifcfg-lo|:|rpmsave|rpmorig|rpmnew)' | \
egrep -v '(~|\.bak)$' | egrep -v 'ifcfg-ippp[0-9]+$' | \
egrep 'ifcfg-[a-z0-9]+$' | sed 's/^ifcfg-//g' | egrep -v '^eth0'`
^^^^^^^^^^^^^^^^^^
interfaces="$eth_interfaces $non_eth_interfaces"
HTH
-kev
--
"The majority of the stupid is invincible and guaranteed
for all time. The terror of their tyranny, however, is
alleviated by their lack of consistency."
- Albert Einstein
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!