From 39136d2dc85adf007619e8560e9df78b9957ece1 Mon Sep 17 00:00:00 2001 From: Luigi Cruz Date: Thu, 7 Oct 2021 16:46:10 -0300 Subject: [PATCH] remove dump1090 --- stage4/32-pisdr-dump1090/00-run.sh | 55 ------------------- .../targets/configure_fr24feed.sh | 27 --------- .../targets/configure_rbfeeder.sh | 22 -------- stage4/32-pisdr-dump1090/targets/disable.sh | 5 -- stage4/32-pisdr-dump1090/targets/enable.sh | 5 -- .../targets/install_tar1090.sh | 21 ------- stage4/32-pisdr-dump1090/targets/readsb-gain | 6 -- .../targets/readsb-set-location | 39 ------------- 8 files changed, 180 deletions(-) delete mode 100755 stage4/32-pisdr-dump1090/00-run.sh delete mode 100755 stage4/32-pisdr-dump1090/targets/configure_fr24feed.sh delete mode 100755 stage4/32-pisdr-dump1090/targets/configure_rbfeeder.sh delete mode 100755 stage4/32-pisdr-dump1090/targets/disable.sh delete mode 100755 stage4/32-pisdr-dump1090/targets/enable.sh delete mode 100755 stage4/32-pisdr-dump1090/targets/install_tar1090.sh delete mode 100755 stage4/32-pisdr-dump1090/targets/readsb-gain delete mode 100755 stage4/32-pisdr-dump1090/targets/readsb-set-location diff --git a/stage4/32-pisdr-dump1090/00-run.sh b/stage4/32-pisdr-dump1090/00-run.sh deleted file mode 100755 index 5d35894..0000000 --- a/stage4/32-pisdr-dump1090/00-run.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/bash -e - -install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090/" -install -v -o 1000 -g 1000 -m 755 targets/enable.sh "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090/" -install -v -o 1000 -g 1000 -m 755 targets/disable.sh "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090/" -install -v -o 1000 -g 1000 -m 755 targets/configure_rbfeeder.sh "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090/" -install -v -o 1000 -g 1000 -m 755 targets/configure_fr24feed.sh "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090/" - -install -v -o 1000 -g 1000 -m 755 targets/readsb-set-location "${ROOTFS_DIR}/usr/local/bin/" -install -v -o 1000 -g 1000 -m 755 targets/readsb-gain "${ROOTFS_DIR}/usr/local/bin/" - -on_chroot << EOF -cd "/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090" - -mkdir -p /usr/local/share/adsb-wiki/readsb-install - -apt-get update -apt-get install --no-install-recommends --no-install-suggests -y git build-essential debhelper libusb-1.0-0-dev \ - pkg-config dh-systemd libncurses5-dev lighttpd zlib1g-dev zlib1g unzip - -rm -rf /usr/local/share/adsb-wiki/readsb-install/git -if ! git clone --branch stale --depth 1 https://github.com/wiedehopf/readsb.git "/usr/local/share/adsb-wiki/readsb-install/git" -then - echo "Unable to git clone the repository" - exit 1 -fi - -rm -rf /usr/local/share/adsb-wiki/readsb-install/readsb*.deb - -cd /usr/local/share/adsb-wiki/readsb-install/git - -export DEB_BUILD_OPTIONS=noddebs -if ! dpkg-buildpackage -d -b -Prtlsdr -ui -uc -us -then - echo "Something went wrong building the debian package, exiting!" - exit 1 -fi - -echo "Installing the Package" -if ! dpkg --force-all -i ../readsb_*.deb -then - echo "Something went wrong installing the debian package, exiting!" - exit 1 -fi -echo "Package installed!" - -cp -n debian/lighttpd/* /etc/lighttpd/conf-available - -echo "[PiSDR] Disabling services. To enable them, run 'bash enable.sh'." - -systemctl disable --now readsb || true -systemctl disable --now tar1090 || true -systemctl disable --now lighttpd || true - -EOF diff --git a/stage4/32-pisdr-dump1090/targets/configure_fr24feed.sh b/stage4/32-pisdr-dump1090/targets/configure_fr24feed.sh deleted file mode 100755 index 4f6db73..0000000 --- a/stage4/32-pisdr-dump1090/targets/configure_fr24feed.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash - -# configure fr24feed to use readsb - -systemctl stop fr24feed &>/dev/null - -rm -f /etc/lighttpd/conf-enabled/89-dump1090.conf - -apt-get remove -y dump1090-mutability &>/dev/null -apt-get remove -y dump1090 &>/dev/null -apt-get remove -y dump1090-fa &>/dev/null - -if [ -f /etc/fr24feed.ini ] -then - chmod a+rw /etc/fr24feed.ini - cp -n /etc/fr24feed.ini /usr/local/share/adsb-wiki - if ! grep host /etc/fr24feed.ini &>/dev/null; then sed -i -e '/fr24key/a host=' /etc/fr24feed.ini; fi - sed -i -e 's/receiver=.*/receiver="beast-tcp"\r/' -e 's/host=.*/host="127.0.0.1:30005"\r/' -e 's/bs=.*/bs="no"\r/' -e 's/raw=.*/raw="no"\r/' /etc/fr24feed.ini - systemctl restart fr24feed &>/dev/null -fi - -if (( $(cat /etc/lighttpd/conf-enabled/* | grep -c -E -e '^server.stat-cache-engine *\= *"disable"') > 1 )); then - rm -f /etc/lighttpd/conf-enabled/88-readsb-statcache.conf -fi - -systemctl enable readsb -systemctl restart readsb diff --git a/stage4/32-pisdr-dump1090/targets/configure_rbfeeder.sh b/stage4/32-pisdr-dump1090/targets/configure_rbfeeder.sh deleted file mode 100755 index 88f130b..0000000 --- a/stage4/32-pisdr-dump1090/targets/configure_rbfeeder.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/bash - -# configure rbfeeder to use readsb - -systemctl stop rb-feeder &>/dev/null - -rm -f /etc/lighttpd/conf-enabled/89-dump1090.conf - -apt-get remove -y dump1090-mutability &>/dev/null -apt-get remove -y dump1090 &>/dev/null -apt-get remove -y dump1090-fa &>/dev/null - -if [[ -f /etc/rbfeeder.ini ]]; then - if grep -qs -e 'network_mode=false' /etc/rbfeeder.ini &>/dev/null && - grep -qs -e 'mode=beast' /etc/rbfeeder.ini && - grep -qs -e 'external_port=30005' /etc/rbfeeder.ini && - grep -qs -e 'external_host=127.0.0.1' /etc/rbfeeder.ini - then - sed -i -e 's/network_mode=false/network_mode=true/' /etc/rbfeeder.ini - fi - systemctl restart rbfeeder &>/dev/null -fi diff --git a/stage4/32-pisdr-dump1090/targets/disable.sh b/stage4/32-pisdr-dump1090/targets/disable.sh deleted file mode 100755 index 2992e63..0000000 --- a/stage4/32-pisdr-dump1090/targets/disable.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -systemctl disable --now readsb -systemctl disable --now tar1090 -systemctl disable --now lighttpd diff --git a/stage4/32-pisdr-dump1090/targets/enable.sh b/stage4/32-pisdr-dump1090/targets/enable.sh deleted file mode 100755 index 365f99d..0000000 --- a/stage4/32-pisdr-dump1090/targets/enable.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/bash - -systemctl enable --now readsb -systemctl enable --now tar1090 -systemctl enable --now lighttpd diff --git a/stage4/32-pisdr-dump1090/targets/install_tar1090.sh b/stage4/32-pisdr-dump1090/targets/install_tar1090.sh deleted file mode 100755 index 64e68a0..0000000 --- a/stage4/32-pisdr-dump1090/targets/install_tar1090.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -cd /usr/local/share/adsb-wiki/readsb-install - -wget -O tar1090-install.sh https://raw.githubusercontent.com/wiedehopf/tar1090/master/install.sh -bash tar1090-install.sh /run/readsb - -if ! systemctl show readsb | grep 'ExecMainStatus=0' -qs; then - echo -------------- - echo -------------- - journalctl -u readsb | tail -n30 - echo -------------- - echo -------------- - echo "ERROR: readsb service didn't start, if inquiring about the issue please post the above 30 lines of log!" - echo " common issues: SDR not plugged in." - echo " the webinterface will show an error until readsb is running!" - echo -------------- -fi - -rm -fr /usr/local/share/tar1090/git-db -rm -fr /usr/local/share/tar1090/git \ No newline at end of file diff --git a/stage4/32-pisdr-dump1090/targets/readsb-gain b/stage4/32-pisdr-dump1090/targets/readsb-gain deleted file mode 100755 index e8d6343..0000000 --- a/stage4/32-pisdr-dump1090/targets/readsb-gain +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash -gain=$(echo $1 | tr -cd '[:digit:].-') -if [[ $gain == "" ]]; then echo "Error, invalid gain!"; exit 1; fi -if ! grep gain /etc/default/readsb &>/dev/null; then sed -i -e 's/RECEIVER_OPTIONS="/RECEIVER_OPTIONS="--gain 49.6 /' /etc/default/readsb; fi -sudo sed -i -E -e "s/--gain .?[0-9]*.?[0-9]* /--gain $gain /" /etc/default/readsb -sudo systemctl restart readsb \ No newline at end of file diff --git a/stage4/32-pisdr-dump1090/targets/readsb-set-location b/stage4/32-pisdr-dump1090/targets/readsb-set-location deleted file mode 100755 index 3244601..0000000 --- a/stage4/32-pisdr-dump1090/targets/readsb-set-location +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash - -lat=$(echo $1 | tr -cd '[:digit:].-') -lon=$(echo $2 | tr -cd '[:digit:].-') - -if ! awk "BEGIN{ exit ($lat > 90) }" || ! awk "BEGIN{ exit ($lat < -90) }"; then - echo - echo "Invalid latitude: $lat" - echo "Latitude must be between -90 and 90" - echo - echo "Example format for latitude: 51.528308" - echo - echo "Usage:" - echo "readsb-set-location 51.52830 -0.38178" - echo - exit 1 -fi -if ! awk "BEGIN{ exit ($lon > 180) }" || ! awk "BEGIN{ exit ($lon < -180) }"; then - echo - echo "Invalid longitude: $lon" - echo "Longitude must be between -180 and 180" - echo - echo "Example format for latitude: -0.38178" - echo - echo "Usage:" - echo "readsb-set-location 51.52830 -0.38178" - echo - exit 1 -fi - -echo -echo "setting Latitude: $lat" -echo "setting Longitude: $lon" -echo -if ! grep -e '--lon' /etc/default/readsb &>/dev/null; then sed -i -e 's/DECODER_OPTIONS="/DECODER_OPTIONS="--lon -0.38178 /' /etc/default/readsb; fi -if ! grep -e '--lat' /etc/default/readsb &>/dev/null; then sed -i -e 's/DECODER_OPTIONS="/DECODER_OPTIONS="--lat 51.52830 /' /etc/default/readsb; fi -sed -i -E -e "s/--lat .?[0-9]*.?[0-9]* /--lat $lat /" /etc/default/readsb -sed -i -E -e "s/--lon .?[0-9]*.?[0-9]* /--lon $lon /" /etc/default/readsb -systemctl restart readsb \ No newline at end of file