bazarr-install.sh 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 "Updating Python3"
  19. $STD apt-get install -y \
  20. python3 \
  21. python3-dev \
  22. python3-pip
  23. msg_ok "Updated Python3"
  24. msg_info "Installing Bazarr"
  25. mkdir -p /var/lib/bazarr/
  26. wget -q https://github.com/morpheus65535/bazarr/releases/latest/download/bazarr.zip
  27. unzip -qq bazarr -d /opt/bazarr
  28. chmod 775 /opt/bazarr /var/lib/bazarr/
  29. python3 -m pip install -q -r /opt/bazarr/requirements.txt
  30. msg_ok "Installed Bazarr"
  31. msg_info "Creating Service"
  32. cat <<EOF >/etc/systemd/system/bazarr.service
  33. [Unit]
  34. Description=Bazarr Daemon
  35. After=syslog.target network.target
  36. [Service]
  37. WorkingDirectory=/opt/bazarr/
  38. UMask=0002
  39. Restart=on-failure
  40. RestartSec=5
  41. Type=simple
  42. ExecStart=/usr/bin/python3 /opt/bazarr/bazarr.py
  43. KillSignal=SIGINT
  44. TimeoutStopSec=20
  45. SyslogIdentifier=bazarr
  46. [Install]
  47. WantedBy=multi-user.target
  48. EOF
  49. systemctl enable -q --now bazarr
  50. msg_ok "Created Service"
  51. motd_ssh
  52. customize
  53. msg_info "Cleaning up"
  54. rm -rf bazarr.zip
  55. $STD apt-get autoremove
  56. $STD apt-get autoclean
  57. msg_ok "Cleaned"