-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_rtl-433.sh
executable file
·50 lines (47 loc) · 1.17 KB
/
install_rtl-433.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
47
48
49
50
#!/bin/bash
#to run this script go into the folder where it is then run: ./install_rtl-433.sh
#
set -eu
#
function check_install {
for var in "$@"
do
echo "checking install: $var"
dpkg -l | grep -qw $var || sudo apt-get install $var -y
done
}
#
#sudo apt-get install libtool libusb-1.0.0-dev librtlsdr-dev rtl-sdr build-essential autoconf cmake pkg-config git doxygen -y
check_install libtool libusb-1.0.0-dev librtlsdr-dev rtl-sdr build-essential autoconf cmake pkg-config git doxygen
#
if [ -d "/home/$USER/programs_setup/rtl_433" ]; then
cd /home/$USER/programs_setup/rtl_433/build
sudo make uninstall
cd /home/$USER/
sudo rm -rf /home/$USER/programs_setup/rtl_433
fi
#
mkdir -p /home/$USER/programs_setup/
cd /home/$USER/programs_setup/
git clone https://github.com/merbanan/rtl_433.git
cd rtl_433
mkdir build
cd build
cmake ../
#
minnum=1
cpunum=$(expr $(nproc --all) - 1)
echo "number of cpus less one $cpunum"
usenum=1
if (( cpunum > minnum )); then
usenum=$cpunum
echo "using $usenum cpus."
else
echo "using only $usenum cpu."
fi
#
#make -j4 # Compile using 4 threads (change to your number of CPUs)
make -j$usenum
#
sudo make install
#rtl_433 -C si