tar -xvjf ./rtl-sdr-v2.0.2.tar.bz2

cd ./librtlsdr-2.0.2
./configure
make

exit

make install


echo 'blacklist dvb_usb_rtl28xxu' | tee --append /etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf
echo 'blacklist dvb_usb_rtl2832u' | tee --append /etc/modprobe.d/blacklist-dvb_usb_rtl28xxu.conf

cp ../rtl-sdr.rules /etc/udev/rules.d/rtl-sdr.rules
udevadm control --reload-rules && udevadm trigger



if [ ! -f /lib/systemd/system/openwebrx.service.bak ] ; then
    cp /lib/systemd/system/openwebrx.service /lib/systemd/system/openwebrx.service.bak
fi


cp ./openwebrx.service /lib/systemd/openwebrx.service
