3 if [ -f /etc/sysconfig/network ]; then
4 . /etc/sysconfig/network
7 ib_sysfs="/sys/class/infiniband"
13 echo "Usage: `basename $0` [-hv] [<name>]"
14 echo " set the node_desc field of all hca's found in \"$ib_sysfs\""
16 echo " -v view all node descriptors"
17 echo " [<name>] set name to name specified."
18 echo " Default is to use the hostname: \"$HOSTNAME\""
24 for hca in `ls $ib_sysfs`; do
25 if [ -f $ib_sysfs/$hca/node_desc ]; then
27 cat $ib_sysfs/$hca/node_desc
29 logger -s "Failed to set node_desc for : $hca"
35 while getopts "hv" flag
43 shift $(($OPTIND - 1))
45 if [ "$1" != "" ]; then
49 for hca in `ls $ib_sysfs`; do
50 if [ -f $ib_sysfs/$hca/node_desc ]; then
51 echo -n "$newname" >> $ib_sysfs/$hca/node_desc
53 logger -s "Failed to set node_desc for : $hca"