motioneye-install.sh 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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 git
  18. $STD apt-get install -y cifs-utils
  19. msg_ok "Installed Dependencies"
  20. msg_info "Installing Motion"
  21. $STD apt-get install -y motion
  22. systemctl stop motion
  23. $STD systemctl disable motion
  24. msg_ok "Installed Motion"
  25. msg_info "Installing FFmpeg"
  26. $STD apt-get install -y ffmpeg v4l-utils
  27. msg_ok "Installed FFmpeg"
  28. msg_info "Installing Python3-pip"
  29. $STD apt-get install -y python3-pip
  30. msg_ok "Installed Python3-pip"
  31. msg_info "Installing MotionEye"
  32. $STD apt-get update
  33. $STD pip install git+https://github.com/motioneye-project/motioneye.git@dev
  34. mkdir -p /etc/motioneye
  35. chown -R root:root /etc/motioneye
  36. chmod -R 777 /etc/motioneye
  37. cp /usr/local/lib/python3.9/dist-packages/motioneye/extra/motioneye.conf.sample /etc/motioneye/motioneye.conf
  38. mkdir -p /var/lib/motioneye
  39. msg_ok "Installed MotionEye"
  40. msg_info "Creating Service"
  41. cp /usr/local/lib/python3.9/dist-packages/motioneye/extra/motioneye.systemd /etc/systemd/system/motioneye.service
  42. systemctl enable -q --now motioneye
  43. msg_ok "Created Service"
  44. motd_ssh
  45. root
  46. msg_info "Cleaning up"
  47. $STD apt-get autoremove
  48. $STD apt-get autoclean
  49. msg_ok "Cleaned"