-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·105 lines (91 loc) · 1.93 KB
/
install.sh
File metadata and controls
executable file
·105 lines (91 loc) · 1.93 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
#!/bin/bash
if [ "$EUID" -ne 0 ]
then echo "Please run as root: sudo" $0
exit
fi
# Install requirements
apt-get update
apt-get install -y \
git unzip make \
libusb-1.0 cmake build-essential libpulse-dev libx11-dev \
python3 python3-pip python3-venv
# Temp directory
mkdir -p .tmp
rm -rf .tmp/*
# Install RTL-SDR
install_sdr() {
cd .tmp
git clone git://git.osmocom.org/RTL-SDR.git
cd RTL-SDR
mkdir build
cd build
cmake ../ -DINSTALL_UDEV_RULES=ON
make
make install
ldconfig
# Blacklist drivers to prevent kernel from claiming them
BLACKLIST=/etc/modprobe.d/raspi-blacklist.conf
if ! cat $BLACKLIST &> /dev/null
then
BLACKLIST=/etc/modprobe.d/blacklist.conf
fi
DRIVERS="dvb_usb_rtl28xxu rtl2832 rtl2830"
for DRIVER in $DRIVERS
do
if ! cat $BLACKLIST | grep $DRIVER &> /dev/null
then
print 2 "Adding $DRIVER to the blacklist..."
echo "blacklist $DRIVER" | tee -a $BLACKLIST
else
print 3 "$DRIVER already on blacklist."
fi
done
echo "Installation of RTL-SDR complete!"
cd ../../../
}
# Install Multimon
install_mng() {
cd .tmp
wget https://github.com/EliasOenal/multimon-ng/archive/1.1.9.zip
unzip 1.1.9.zip
cd multimon-ng-1.1.9
mkdir build
cd build
cmake ../
make
make install
cd ../../../
}
# Check RTL-SDR
if ! command -v rtl_test &> /dev/null
then
read -p "RTL-SDR not found! Install? " yn
case $yn in
[Yy]* ) install_sdr; break;;
* ) ;;
esac
else
echo "RTL-SDR already installed!"
fi
# Check Multimon
if ! command -v multimon-ng &> /dev/null
then
read -p "Multimon-NG not found! Install? " yn
case $yn in
[Yy]* ) install_mng; break;;
* ) ;;
esac
else
echo "Multimon-NG already installed!"
fi
# Create python venv
if [ ! -f "venv/bin/python" ]; then
echo "Creating virtual python environment..."
python -m pip venv venv
source venv/bin/activate
echo "Installing / updating packages..."
python -m pip install -r requirements.txt
fi
# Cleanup
rm -rf .tmp
echo "Installation complete!"