Merge pull request #72 from mcguirepr89/bullseye

Bullseye
This commit is contained in:
Patrick McGuire
2021-11-10 09:53:26 -05:00
committed by GitHub
4 changed files with 21 additions and 14 deletions
+1 -1
View File
@@ -10,6 +10,6 @@ fi
git clone -b ${branch} https://github.com/mcguirepr89/BirdNET-Pi.git ${HOME}/BirdNET-Pi
echo 'Now, run the following script
sudo -E ${HOME}/BirdNET-Pi/scripts/birdnet-pi-config
/home/pi/BirdNET-Pi/scripts/birdnet-pi-config
'
+14 -8
View File
@@ -52,16 +52,22 @@ install_birdnet() {
source ./birdnet/bin/activate
echo "Upgrading pip, wheel, and setuptools"
pip3 install --upgrade pip wheel setuptools
if [ ! -f $(dirname ${my_dir})/tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl ];then
echo "Fetching the TFLite pre-built binaries"
TFLITE_URL="https://drive.google.com/uc?export=download&id=1dlEbugFDJXs-YDBCUC6WjADVtIttWxZA"
curl -c /tmp/cookie ${TFLITE_URL}
CODE="$(awk '/_warning_/ {print $NF}' /tmp/cookie)"
TF_COOKIE="https://drive.google.com/uc?export=download&confirm=${CODE}&id=1dlEbugFDJXs-YDBCUC6WjADVtIttWxZA"
curl -Lb /tmp/cookie ${TF_COOKIE} -o tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl
fi
set -x
python_version="$(awk -F. '{print $2}' <(ls -l $(which /usr/bin/python3)))"
echo "python_version=${python_version}"
# TFLite Pre-built binaires from https://github.com/PINTO0309/TensorflowLite-bin
# Python 3.7
if [[ "$python_version" == 7 ]];then
echo "Installing the TFLite bin wheel"
pip3 install --upgrade tflite_runtime-2.6.0-cp37-none-linux_aarch64.whl
fi
# Python 3.9
if [[ "$python_version" == 9 ]];then
echo "Installing the TFLite bin wheel"
pip3 install --upgrade tflite_runtime-2.6.0-cp39-none-linux_aarch64.whl
fi
set +x
echo "Installing colorama==0.4.4"
pip3 install colorama==0.4.4
echo "Installing librosa"
+6 -5
View File
@@ -210,6 +210,7 @@ install_Caddyfile() {
cp /etc/caddy/Caddyfile{,.original}
fi
HASHWORD=$(caddy hash-password -plaintext ${CADDY_PWD})
php_version="$(awk -F. '{print $2}' <(ls -l $(which /etc/alternatives/php)))"
cat << EOF > /etc/caddy/Caddyfile
http://localhost http://birdnetpi.local ${BIRDNETPI_URL} {
root * ${EXTRACTED}
@@ -227,7 +228,7 @@ http://localhost http://birdnetpi.local ${BIRDNETPI_URL} {
birdnet ${HASHWORD}
}
reverse_proxy /stream localhost:8000
php_fastcgi unix//run/php/php7.3-fpm.sock
php_fastcgi unix//run/php/php7.${php_version}-fpm.sock
}
EOF
if [ ! -z ${EXTRACTIONLOG_URL} ];then
@@ -352,16 +353,16 @@ install_sox() {
}
install_php() {
if ! which php &> /dev/null || ! which php-fpm7.3 || ! apt list --installed | grep php-xml;then
if ! which php &> /dev/null || ! which php-fpm || ! apt list --installed | grep php-xml;then
echo "Installing PHP modules"
apt -qq update
apt install -qqy php php-fpm php7.3-mysql php-xml
apt install -qqy php php-fpm php-mysql php-xml
else
echo "PHP and PHP-FPM installed"
fi
echo "Configuring PHP for Caddy"
sed -i 's/www-data/caddy/g' /etc/php/7.3/fpm/pool.d/www.conf
systemctl restart php7.3-fpm.service
sed -i 's/www-data/caddy/g' /etc/php/*/fpm/pool.d/www.conf
systemctl restart php7\*-fpm.service
echo "Adding Caddy sudoers rule"
cat << EOF > /etc/sudoers.d/010_caddy-nopasswd
caddy ALL=(ALL) NOPASSWD: ALL
Binary file not shown.