unifi-install.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/env bash
  2. # Copyright (c) 2021-2023 tteck
  3. # Author: tteck (tteckster)
  4. # License: MIT
  5. # https://github.com/tteck/Proxmox/raw/main/LICENSE
  6. source /dev/stdin <<< "$FUNCTIONS_FILE_PATH"
  7. color
  8. verb_ip6
  9. catch_errors
  10. setting_up_container
  11. network_check
  12. update_os
  13. msg_info "Installing Dependencies"
  14. $STD apt-get install -y curl
  15. $STD apt-get install -y sudo
  16. $STD apt-get install -y mc
  17. $STD apt-get install -y apt-transport-https
  18. msg_ok "Installed Dependencies"
  19. if [[ "$PCT_OSVERSION" == "12" ]]; then
  20. echo -e "deb http://ftp.debian.org/debian bullseye main" >/etc/apt/sources.list.d/openjdk-11-jre-headless.list
  21. $STD apt-get update
  22. fi
  23. msg_info "Installing OpenJDK"
  24. $STD apt-get install -y openjdk-11-jre-headless
  25. $STD apt-mark hold openjdk-11-*
  26. msg_ok "Installed OpenJDK"
  27. msg_info "Installing MongoDB"
  28. wget -qL http://security.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
  29. $STD dpkg -i libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
  30. wget -qL https://repo.mongodb.org/apt/ubuntu/dists/bionic/mongodb-org/3.6/multiverse/binary-amd64/mongodb-org-server_3.6.23_amd64.deb
  31. $STD dpkg -i mongodb-org-server_3.6.23_amd64.deb
  32. msg_ok "Installed MongoDB"
  33. msg_info "Installing UniFi Network Application"
  34. wget -qO /etc/apt/trusted.gpg.d/unifi-repo.gpg https://dl.ui.com/unifi/unifi-repo.gpg
  35. echo 'deb https://www.ui.com/downloads/unifi/debian stable ubiquiti' >/etc/apt/sources.list.d/100-ubnt-unifi.list
  36. $STD apt-get update
  37. $STD apt-get install -y unifi
  38. msg_ok "Installed UniFi Network Application"
  39. motd_ssh
  40. customize
  41. msg_info "Cleaning up"
  42. rm -rf mongodb-org-server_3.6.23_amd64.deb libssl1.1_1.1.1f-1ubuntu2.19_amd64.deb
  43. $STD apt-get autoremove
  44. $STD apt-get autoclean
  45. msg_ok "Cleaned"