adjusting for bullseye installation

This commit is contained in:
Patrick McGuire
2021-11-10 08:55:39 -05:00
parent 3fb263e565
commit fa353927aa
6 changed files with 23 additions and 17 deletions
+1 -1
View File
@@ -3,7 +3,7 @@ set -e
USER=pi
HOME=/home/pi
my_dir=${HOME}/BirdNET-Pi
branch=main
branch=bullseye
trap '${my_dir}/scripts/dump_logs.sh && exit' EXIT SIGHUP SIGINT
if [ "$(uname -m)" != "aarch64" ];then
+2 -2
View File
@@ -2,7 +2,7 @@
# Simple new installer
HOME=/home/pi
USER=pi
branch=main
branch=bullseye
sudo apt update
if ! which git &> /dev/null;then
sudo apt -y install git
@@ -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
'
+1 -1
View File
@@ -7,7 +7,7 @@
#set -x
birdnetpi_dir=/home/pi/BirdNET-Pi
birders_config=${birdnetpi_dir}/Birders_Guide_Installer_Configuration.txt
branch=main
branch=bullseye
INTERACTIVE=True
ASK_TO_REBOOT=0
BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf
+13 -8
View File
@@ -52,16 +52,21 @@ 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
python_version="$(awk -F. '{print $2}' <(ls -l $(which python3)))"
# TFLite Pre-built binaires from https://github.com/PINTO0309/TensorflowLite-bin
# Python 3.7
if [ "$python_version" -eq 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" -eq 9 ];then
echo "Installing the TFLite bin wheel"
pip3 install --upgrade tflite_runtime-2.6.0-cp39-none-linux_aarch64.whl
fi
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.