agentdvr-install.sh 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 unzip
  18. $STD apt-get install -y apt-transport-https
  19. $STD apt-get install -y alsa-utils
  20. $STD apt-get install -y libxext-dev
  21. $STD apt-get install -y fontconfig
  22. msg_ok "Installed Dependencies"
  23. msg_info "Installing AgentDVR"
  24. mkdir -p /opt/agentdvr/agent
  25. RELEASE=$(curl -s "https://www.ispyconnect.com/api/Agent/DownloadLocation4?platform=Linux64&fromVersion=0" | grep -o 'https://.*\.zip')
  26. cd /opt/agentdvr/agent
  27. wget -q $RELEASE
  28. $STD unzip Agent_Linux64*.zip
  29. rm -rf Agent_Linux64*.zip
  30. chmod +x ./Agent
  31. msg_ok "Installed AgentDVR"
  32. msg_info "Creating Service"
  33. cat <<EOF >/etc/systemd/system/agentdvr.service
  34. [Unit]
  35. Description=AgentDVR
  36. [Service]
  37. WorkingDirectory=/opt/agentdvr/agent
  38. ExecStart=/opt/agentdvr/agent/./Agent
  39. Environment="MALLOC_TRIM_THRESHOLD_=100000"
  40. SyslogIdentifier=AgentDVR
  41. Restart=always
  42. RestartSec=5
  43. [Install]
  44. WantedBy=multi-user.target
  45. EOF
  46. systemctl enable -q --now agentdvr.service
  47. msg_ok "Created Service"
  48. motd_ssh
  49. customize
  50. msg_info "Cleaning up"
  51. $STD apt-get autoremove
  52. $STD apt-get autoclean
  53. msg_ok "Cleaned"