sabnzbd-install.sh 1.7 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 mc
  17. $STD apt-get install -y par2
  18. $STD apt-get install -y p7zip-full
  19. wget -q http://http.us.debian.org/debian/pool/non-free/u/unrar-nonfree/unrar_6.0.3-1+deb11u1_amd64.deb
  20. $STD dpkg -i unrar_6.0.3-1+deb11u1_amd64.deb
  21. rm unrar_6.0.3-1+deb11u1_amd64.deb
  22. msg_ok "Installed Dependencies"
  23. msg_info "Installing Python3-pip"
  24. $STD apt-get install -y python3-setuptools
  25. $STD apt-get install -y python3-pip
  26. msg_ok "Installed Python3-pip"
  27. msg_info "Installing SABnzbd"
  28. RELEASE=$(curl -s https://api.github.com/repos/sabnzbd/sabnzbd/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
  29. $STD tar zxvf <(curl -fsSL https://github.com/sabnzbd/sabnzbd/releases/download/$RELEASE/SABnzbd-${RELEASE}-src.tar.gz)
  30. mv SABnzbd-${RELEASE} /opt/sabnzbd
  31. cd /opt/sabnzbd
  32. $STD python3 -m pip install -r requirements.txt
  33. msg_ok "Installed SABnzbd"
  34. msg_info "Creating Service"
  35. service_path="/etc/systemd/system/sabnzbd.service"
  36. echo "[Unit]
  37. Description=SABnzbd
  38. After=network.target
  39. [Service]
  40. WorkingDirectory=/opt/sabnzbd
  41. ExecStart=python3 SABnzbd.py -s 0.0.0.0:7777
  42. Restart=always
  43. User=root
  44. [Install]
  45. WantedBy=multi-user.target" >$service_path
  46. systemctl enable --now -q sabnzbd.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"