forked from librtlsdr/librtlsdr
-
Notifications
You must be signed in to change notification settings - Fork 4
/
install-blacklist.sh
executable file
·26 lines (23 loc) · 1000 Bytes
/
install-blacklist.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
#!/bin/bash
BLACKLIST_FN=""
if [ -f /etc/modprobe.d/rtlsdr-blacklist.conf ]; then
BLACKLIST_FN="rtlsdr-blacklist.conf"
echo "found /etc/modprobe.d/${BLACKLIST_FN}"
elif [ -f /etc/modprobe.d/blacklist-rtl8xxxu.conf ]; then
BLACKLIST_FN="blacklist-rtl8xxxu.conf"
echo "found /etc/modprobe.d/${BLACKLIST_FN}"
elif [ -f /etc/modprobe.d/raspi-blacklist.conf ]; then
BLACKLIST_FN="raspi-blacklist.conf"
echo "found /etc/modprobe.d/${BLACKLIST_FN}"
else
BLACKLIST_FN="rtlsdr-blacklist.conf"
echo "could not find existing blacklist. will use /etc/modprobe.d/${BLACKLIST_FN}"
fi
if [ -f /etc/modprobe.d/${BLACKLIST_FN} ]; then
cat /etc/modprobe.d/${BLACKLIST_FN} rtlsdr-blacklist.conf | sort | uniq >/dev/shm/${BLACKLIST_FN}
cp /dev/shm/${BLACKLIST_FN} /etc/modprobe.d/${BLACKLIST_FN}
echo "updated /etc/modprobe.d/${BLACKLIST_FN} ; reboot to apply"
else
cp rtlsdr-blacklist.conf /etc/modprobe.d/${BLACKLIST_FN}
echo "created /etc/modprobe.d/${BLACKLIST_FN} ; reboot to apply"
fi