Files
ProxmoxVE/install/sabnzbd-install.sh
T

71 lines
1.8 KiB
Bash
Raw Normal View History

2023-03-22 20:48:20 -04:00
#!/usr/bin/env bash
# Copyright (c) 2021-2026 tteck
2025-04-29 20:08:11 +02:00
# Author: tteck (tteckster) | Co-Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://sabnzbd.org/ | Github: https://github.com/sabnzbd/sabnzbd
2023-03-22 20:48:20 -04:00
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
2023-03-22 20:48:20 -04:00
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
2025-10-15 22:58:08 +02:00
$STD apt install -y \
par2 \
p7zip-full
2025-04-29 20:08:11 +02:00
msg_ok "Installed Dependencies"
PYTHON_VERSION="3.13" setup_uv
2025-04-29 20:08:11 +02:00
msg_info "Setup Unrar"
cat <<EOF >/etc/apt/sources.list.d/non-free.sources
Types: deb
URIs: http://deb.debian.org/debian/
Suites: trixie
Components: non-free
Signed-By: /usr/share/keyrings/debian-archive-keyring.gpg
2024-04-06 09:05:33 -04:00
EOF
apt_update_safe
2025-10-15 22:58:08 +02:00
$STD apt install -y unrar
2025-04-29 20:08:11 +02:00
msg_ok "Setup Unrar"
2023-03-22 20:48:20 -04:00
fetch_and_deploy_gh_release "sabnzbd-org" "sabnzbd/sabnzbd" "prebuild" "latest" "/opt/sabnzbd" "SABnzbd-*-src.tar.gz"
2023-03-22 20:48:20 -04:00
msg_info "Installing SABnzbd"
$STD uv venv --clear /opt/sabnzbd/venv
2025-04-29 20:08:11 +02:00
$STD uv pip install -r /opt/sabnzbd/requirements.txt --python=/opt/sabnzbd/venv/bin/python
2023-03-22 20:48:20 -04:00
msg_ok "Installed SABnzbd"
prompt="${var_sabnzbd_par2_turbo:-}"
[[ -n "$prompt" ]] || read -r -p "Would you like to install par2cmdline-turbo? <y/N> " prompt || true
if [[ "${prompt,,}" =~ ^(y|yes)$ ]]; then
mv /usr/bin/par2 /usr/bin/par2.old
fetch_and_deploy_gh_release "par2cmdline-turbo" "animetosho/par2cmdline-turbo" "prebuild" "latest" "/usr/bin/" "*-linux-$(arch_resolve).zip"
fi
2023-03-22 20:48:20 -04:00
msg_info "Creating Service"
2025-04-29 20:08:11 +02:00
cat <<EOF >/etc/systemd/system/sabnzbd.service
[Unit]
2023-03-22 20:48:20 -04:00
Description=SABnzbd
After=network.target
2025-04-29 20:08:11 +02:00
2023-03-22 20:48:20 -04:00
[Service]
WorkingDirectory=/opt/sabnzbd
2025-04-29 20:08:11 +02:00
ExecStart=/opt/sabnzbd/venv/bin/python SABnzbd.py -s 0.0.0.0:7777
2023-03-22 20:48:20 -04:00
Restart=always
User=root
2025-04-29 20:08:11 +02:00
2023-03-22 20:48:20 -04:00
[Install]
2025-04-29 20:08:11 +02:00
WantedBy=multi-user.target
EOF
systemctl enable -q --now sabnzbd
2023-03-22 20:48:20 -04:00
msg_ok "Created Service"
motd_ssh
2023-05-15 07:39:30 -04:00
customize
cleanup_lxc