You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

00-run.sh 2.9 KiB

3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. #!/bin/bash -e
  2. install -v -o 1000 -g 1000 -d "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090/"
  3. install -v -o 1000 -g 1000 -m 755 targets/enable.sh "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090/"
  4. install -v -o 1000 -g 1000 -m 755 targets/disable.sh "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090/"
  5. install -v -o 1000 -g 1000 -m 755 targets/configure_rbfeeder.sh "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090/"
  6. install -v -o 1000 -g 1000 -m 755 targets/configure_fr24feed.sh "${ROOTFS_DIR}/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090/"
  7. install -v -o 1000 -g 1000 -m 755 targets/readsb-set-location "${ROOTFS_DIR}/usr/local/bin/"
  8. install -v -o 1000 -g 1000 -m 755 targets/readsb-gain "${ROOTFS_DIR}/usr/local/bin/"
  9. on_chroot << EOF
  10. cd "/home/${FIRST_USER_NAME}/PiSDR/Software/dump1090"
  11. mkdir -p /usr/local/share/adsb-wiki/readsb-install
  12. apt-get update
  13. apt-get install --no-install-recommends --no-install-suggests -y git build-essential debhelper libusb-1.0-0-dev \
  14. pkg-config dh-systemd libncurses5-dev lighttpd zlib1g-dev zlib1g unzip
  15. rm -rf /usr/local/share/adsb-wiki/readsb-install/git
  16. if ! git clone --branch stale --depth 1 https://github.com/wiedehopf/readsb.git "/usr/local/share/adsb-wiki/readsb-install/git"
  17. then
  18. echo "Unable to git clone the repository"
  19. exit 1
  20. fi
  21. rm -rf /usr/local/share/adsb-wiki/readsb-install/readsb*.deb
  22. cd /usr/local/share/adsb-wiki/readsb-install/git
  23. sed -i 's/librtlsdr0, librtlsdr-dev, //g' debian/control
  24. export DEB_BUILD_OPTIONS=noddebs
  25. if ! dpkg-buildpackage -b -Prtlsdr -ui -uc -us
  26. then
  27. echo "Something went wrong building the debian package, exiting!"
  28. exit 1
  29. fi
  30. echo "Installing the Package"
  31. if ! dpkg -i ../readsb_*.deb
  32. then
  33. echo "Something went wrong installing the debian package, exiting!"
  34. exit 1
  35. fi
  36. echo "Package installed!"
  37. cp -n debian/lighttpd/* /etc/lighttpd/conf-available
  38. echo --------------
  39. cd /usr/local/share/adsb-wiki/readsb-install
  40. wget -O tar1090-install.sh https://raw.githubusercontent.com/wiedehopf/tar1090/master/install.sh
  41. bash tar1090-install.sh /run/readsb
  42. if ! systemctl show readsb | grep 'ExecMainStatus=0' -qs; then
  43. echo --------------
  44. echo --------------
  45. journalctl -u readsb | tail -n30
  46. echo --------------
  47. echo --------------
  48. echo "ERROR: readsb service didn't start, if inquiring about the issue please post the above 30 lines of log!"
  49. echo " common issues: SDR not plugged in."
  50. echo " the webinterface will show an error until readsb is running!"
  51. echo --------------
  52. fi
  53. echo --------------
  54. echo "[PiSDR] Disabling services. To enable them, run 'bash enable.sh'."
  55. systemctl disable --now readsb
  56. systemctl disable --now tar1090
  57. systemctl disable --now lighttpd
  58. echo "[PiSDR] Deleting build files to save space."
  59. rm -fr /usr/local/share/tar1090/git-db
  60. rm -fr /usr/local/share/tar1090/git
  61. EOF