#!/bin/sh if I2C_ADAPTERS=$(i2cdetect -l |wc -l); then echo "PASS: found $I2C_ADAPTERS i2c adapters" else echo "FAIL: no i2c adapters found" exit 1 fi if [ -z "$adapters" ]; then adapters=0 fi while [ $adapters -lt $I2C_ADAPTERS ] do i2cdetect -y $adapters if [ $? -ne 0 ]; then echo "FAIL: detect i2c adapter $adapters failed" else echo "PASS: detect i2c adapter $adapters success" fi adapters=`expr $adapters + 1` sleep 1 done