-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathuninstall.sh
executable file
·35 lines (27 loc) · 1.26 KB
/
uninstall.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
#!/bin/bash
set -e
mv /etc/default/dump1090-fa.airspyconf /etc/default/dump1090-fa &>/dev/null || true
mv /etc/default/readsb.airspyconf /etc/default/readsb &>/dev/null || true
if [ -f /usr/lib/piaware-support/generate-receiver-config ]; then
sed -i -e '/# added by airspy/,+4d' /usr/lib/piaware-support/generate-receiver-config
sed -i -e 's/beast - radarcape - relay/beast - radarcape - relay - other/' /usr/lib/piaware-support/generate-receiver-config
fi
if [ -f /boot/piaware-config.txt ]; then
piaware-config receiver-type ""
piaware-config receiver-host "127.0.0.1"
piaware-config receiver-port "30005"
fi
if [[ -f /boot/adsbx-env ]]; then
sed -i -e 's/^RECEIVER_OPTIONS=.*/RECEIVER_OPTIONS="--device-type rtlsdr"/' /boot/adsbx-env
fi
systemctl disable airspy_adsb
systemctl stop airspy_adsb
systemctl is-enabled piaware &>/dev/null && systemctl restart --no-block piaware || true
systemctl is-enabled dump1090-fa &>/dev/null && systemctl restart --no-block dump1090-fa || true
systemctl is-enabled readsb &>/dev/null && systemctl restart --no-block readsb || true
rm -f /etc/udev/rules.d/airspy_adsb.rules
udevadm control --reload-rules
udevadm trigger
deluser airspy_adsb
echo "------------------------"
echo "airspy-conf uninstall finished successfully!"