forked from MatthewBCooke/BirdNET-Pi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
newinstaller.sh
executable file
·46 lines (39 loc) · 1.02 KB
/
newinstaller.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/usr/bin/env bash
if [ "$EUID" == 0 ]
then echo "Please run as a non-root user."
exit
fi
arch=$(uname -m)
if [ $arch != "aarch64" ] && [ $arch != "x86_64" ];then
echo "BirdNET-Pi requires a 64-bit OS.
It looks like your operating system is using $(uname -m),
but would need to be aarch64 or x86_64.
Please take a look at https://birdnetwiki.pmcgui.xyz for more
information"
exit 1
fi
# Simple new installer
HOME=$HOME
USER=$USER
export HOME=$HOME
export USER=$USER
PACKAGES_MISSING=
for cmd in git jq curl ; 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=debian
git clone -b $branch --depth=1 https://github.com/MatthewBCooke/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