go2rtc-install.sh 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. msg_ok "Installed Dependencies"
  18. msg_info "Installing go2rtc"
  19. mkdir -p /opt/go2rtc
  20. cd /opt/go2rtc
  21. wget -q https://github.com/AlexxIT/go2rtc/releases/latest/download/go2rtc_linux_amd64
  22. chmod +x go2rtc_linux_amd64
  23. msg_ok "Installed go2rtc"
  24. msg_info "Creating Service"
  25. service_path="/etc/systemd/system/go2rtc.service"
  26. echo "[Unit]
  27. Description=go2rtc service
  28. After=network.target
  29. [Service]
  30. Type=simple
  31. User=root
  32. ExecStart=/opt/go2rtc/go2rtc_linux_amd64
  33. [Install]
  34. WantedBy=multi-user.target" >$service_path
  35. systemctl enable -q --now go2rtc
  36. msg_ok "Created Service"
  37. motd_ssh
  38. customize
  39. msg_info "Cleaning up"
  40. $STD apt-get autoremove
  41. $STD apt-get autoclean
  42. msg_ok "Cleaned"