From 7626e938ba86d875cef0aa979b69d682f7e8363a Mon Sep 17 00:00:00 2001 From: arfrie22 <43021241+arfrie22@users.noreply.github.com> Date: Mon, 5 Aug 2024 15:05:54 -0400 Subject: [PATCH] fix if statement --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 911091b6..e8532ca4 100755 --- a/build.sh +++ b/build.sh @@ -6,7 +6,7 @@ function enable_i2c { echo "Enabling i2c" sudo modprobe i2c-dev sudo raspi-config nonint do_i2c 0 - if ! [ grep 'dtparam=i2c_arm=on$' /boot/config.txt ]; then + if [[ -z $(grep 'dtparam=i2c_arm=on$' /boot/config.txt) ]] ; then echo "Setting the i2c clock speed to 400 kHz, you will have to reboot for this to take effect." sudo sed -i -e 's/dtparam=i2c_arm=on$/dtparam=i2c_arm=on,i2c_arm_baudrate=400000/g' /boot/config.txt fi