From fe91d61a1683b8b3f0917bd432c26e8a051e4c0d Mon Sep 17 00:00:00 2001 From: hb9dum Date: Mon, 10 Jan 2022 00:05:04 +0200 Subject: [PATCH] IC2ACTIVE=$(ls /dev/*i2c*)->IC2ACTIVE=$(ls /dev/i2c-1) If IC2ACTIVE=$(ls /dev/*i2c*) is used the subsequent if statement if [ $IC2ACTIVE = "/dev/i2c-1" ] will be false if more than one i2c devices exists even if one of them is i2c-1 e. g. if the following devices exist /dev/i2c-1 /dev/i2c-20 /dev/i2c-21 the test will fail when it should succeed --- rtc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtc b/rtc index 3325687..15089c8 100644 --- a/rtc +++ b/rtc @@ -7,7 +7,7 @@ clear;echo;echo -IC2ACTIVE=$(ls /dev/*i2c*) +IC2ACTIVE=$(ls /dev/i2c-1) if [ $IC2ACTIVE = "/dev/i2c-1" ] then