rtsptoweb-install.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 git
  17. $STD apt-get install -y mc
  18. msg_ok "Installed Dependencies"
  19. msg_info "Installing Golang"
  20. $STD wget https://golang.org/dl/go1.20.1.linux-amd64.tar.gz
  21. $STD tar -xzf go1.20.1.linux-amd64.tar.gz -C /usr/local
  22. $STD ln -s /usr/local/go/bin/go /usr/local/bin/go
  23. rm -rf go1.20.1.linux-amd64.tar.gz
  24. msg_ok "Installed Golang"
  25. msg_info "Installing RTSPtoWeb"
  26. $STD git clone https://github.com/deepch/RTSPtoWeb /opt/rtsptoweb
  27. cat <<EOF >>/opt/rtsptoweb/start
  28. #!/bin/bash
  29. cd /opt/rtsptoweb && GO111MODULE=on go run *.go
  30. EOF
  31. chmod +x /opt/rtsptoweb/start
  32. msg_ok "Installed RTSPtoWeb"
  33. msg_info "Creating Service"
  34. service_path="/etc/systemd/system/rtsptoweb.service"
  35. echo "[Unit]
  36. Description=RTSP to Web Streaming Service
  37. After=network.target
  38. [Service]
  39. Type=simple
  40. User=root
  41. ExecStart=/opt/rtsptoweb/start
  42. [Install]
  43. WantedBy=multi-user.target" >$service_path
  44. systemctl enable -q --now rtsptoweb
  45. msg_ok "Created Service"
  46. motd_ssh
  47. customize
  48. msg_info "Cleaning up"
  49. $STD apt-get autoremove
  50. $STD apt-get autoclean
  51. msg_ok "Cleaned"