Sophie

Sophie

distrib > CentOS > 5 > x86_64 > by-pkgid > 1c0d709241f1e7f4b322280d33525f6d > files > 4

libmlx4-1.0.2-1.el5.i386.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"
}