Files
AvianVisitors/newinstaller.sh
T
Hugh Brown (Saint Aardvark the Carpeted) 085466b35c Use jq for processing JSON when figuring out latitude/longitude
Signed-off-by: Hugh Brown (Saint Aardvark the Carpeted) <aardvark@saintaardvarkthecarpeted.com>
2022-05-01 10:57:44 -07:00

31 lines
647 B
Bash
Executable File

#!/usr/bin/env bash
# Simple new installer
HOME=$HOME
USER=$USER
export HOME=$HOME
export USER=$USER
PACKAGES_MISSING=
for cmd in git jq ; do
if ! which $cmd &> /dev/null;then
PACKAGES_MISSING="${PACKAGES_MISSING} $cmd"
fi
done
if [[ ! -z $PACKAGES_MISSING ]] ; then
sudo apt update
sudo apt -y install $PACKAGES_MISSING
fi
branch=main
git clone -b $branch https://github.com/mcguirepr89/BirdNET-Pi.git ${HOME}/BirdNET-Pi &&
$HOME/BirdNET-Pi/scripts/install_birdnet.sh
if [ ${PIPESTATUS[0]} -eq 0 ];then
echo "Installation completed successfully"
sudo reboot
else
echo "The installation exited unsuccessfully."
exit 1
fi