Sophie

Sophie

distrib > Fedora > 16 > i386 > by-pkgid > 0c7120cf9e3d93356f4244a4fe18342f > files > 4

libmlx4-1.0.2-1.fc16.src.rpm

BEGIN {
	dir="/sys/bus/pci/drivers/mlx4_core"
	if (system("[ -d "dir" ]") != 0)
		exit 1
}
/^[[:xdigit:]]+:[[:xdigit:]]+:[[:xdigit:]]+\.[[:xdigit:]]([[:blank:]](ib|eth|auto))+/ {
	device=$1
	port1=$2
	port2=$3
	if (system("[ -d "dir"/"device" ]") != 0)
		next
	if (system("[ -f "dir"/"device"/port_trigger ]") == 0)
		print "all" > dir"/"device"/port_trigger"
	if (system("[ -f "dir"/"device"/mlx4_port2 ]") == 0)
		print port2 > dir"/"device"/mlx4_port2"
	if (system("[ -f "dir"/"device"/mlx4_port1 ]") == 0)
		print port1 > dir"/"device"/mlx4_port1"
}