Hi,

We have a slightly difference script to do the same. It only relies on /sys:

# Search for infiniband devices and check waits until
# at least one reports that it is ACTIVE

if [[ ! -d /sys/class/infiniband ]]
then
    logger "No infiniband found"
    exit 0
fi

ports=$(ls /sys/class/infiniband/*/ports/*/state)

for (( count = 0; count < 300; count++ ))
do
    for port in ${ports}; do
        if grep -qc ACTIVE $port; then
            logger "Infiniband online at $port"
            exit 0
        fi
    done
    sleep 1
done

logger "Failed to find an active infiniband interface"
exit 1


Ward

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to