diff --git a/birdnet-pi/rootfs/etc/cont-init.d/01-oldcpu.sh b/birdnet-pi/rootfs/etc/cont-init.d/01-oldcpu.sh index 98980b3f2..2c9075925 100755 --- a/birdnet-pi/rootfs/etc/cont-init.d/01-oldcpu.sh +++ b/birdnet-pi/rootfs/etc/cont-init.d/01-oldcpu.sh @@ -4,17 +4,13 @@ set -e # Check if the CPU supports AVX2 if [[ "$(uname -m)" = "x86_64" ]]; then - # Get the CPU flags - cpu_flags=$(lscpu | grep "Flags" | awk '{print $2}') - - # Check if avx2 is NOT present in the flags - if [[ ! "$cpu_flags" =~ "avx2" ]]; then + if lscpu | grep -q "Flags"; then + if ! lscpu | grep -q "avx2"; then bashio::log.warning "NON SUPPORTED CPU DETECTED" - bashio::log.warning "Your CPU doesn't support AVX2, the analyzer service likely won't work." - bashio::log.warning "Trying to install tensorflow instead of tflite_runtime." - - # Uninstall tflite_runtime and install tensorflow + bashio::log.warning "Your cpu doesn't support avx2, the analyzer service will likely won't work" + bashio::log.warning "Trying to install tensorflow instead of tflite_runtime instead" $PYTHON_VIRTUAL_ENV /usr/bin/pip3 uninstall -y tflite_runtime $PYTHON_VIRTUAL_ENV /usr/bin/pip3 install tensorflow fi + fi fi