/usr boot time dependencies

Paul Jakma paul at dishone.st
Wed Aug 20 22:15:11 UTC 2003


On Wed, 20 Aug 2003, Pekka Savola wrote:

> > 	interfaces=`ls /proc/sys/net/ipv6/conf/`
> 
> Yeah, if we can assume proc, that would probably be the simplest thing.

well, sysctl -a afaik requires /proc (can it fall back to sysctl()?)

> I don't know about this either way.  Opinions?

unless sysctl (8) supports sysctl (2) if /proc is absent, read the 
dirs straight from /proc.

> > 	/sbin/ip -6 link | awk '$1 ~ /^[0-9]/ { gsub(":","",$2); print $2}'
> 
> The use of /sbin/ip is non-trivial, for example here it prints out:
> 
> lo
> sit0 at NONE
> eth0
> sit1 at NONE
> cipcb0
> 
> while the interface list (from proc) really is:
> 
> all  default  eth0  lo  sit1

ah yes.. have to remove everything after [:@], this will work:

/sbin/ip -6 link | awk '$1 ~ /^[0-9]/ { sub(/[:@].*/,"",$2); print $2}'

> (and I think the awk thing is a bit too fancy still, but that's
> just my opinion :-)

it means you havnt discovered awk. :)

> Should be, perhaps, but the information will be used to change
> values in the sysctl variables, and these bits of information (for
> whatever reason)  don't seem to be in sync and in the same format..

isnt it fairly much a given that interfaces listed by ip will match 
the sysctl interface config entries?

regards,
-- 
Paul Jakma	paul at clubi.ie	paul at jakma.org	Key ID: 64A2FF6A
	warning: do not ever send email to spam at dishone.st
Fortune:
Teamwork is essential -- it allows you to blame someone else.





More information about the devel mailing list