Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > b9cd0a6ac192ebc35aee8ba9278dfb46 > files > 9

libmlx4-1.0.1-8.fc15.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"
}