#!/usr/bin/env bash # Copyright (c) 2021-2025 tteck # Author: tteck (tteckster) # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://www.deluge-torrent.org/ source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" color verb_ip6 catch_errors setting_up_container network_check update_os msg_info "Installing Dependencies" $STD apt-get install -y python3-libtorrent build-essential msg_ok "Installed Dependencies" PYTHON_VERSION="3.12" setup_uv msg_info "Installing Deluge" mkdir -p /opt/deluge cd /opt/deluge $STD uv venv /opt/deluge/.venv $STD /opt/prometheus-pve-exporter/.venv/bin/python -m ensurepip --upgrade $STD /opt/prometheus-pve-exporter/.venv/bin/python -m pip install --upgrade pip $STD /opt/prometheus-pve-exporter/.venv/bin/python -m pip install deluge libtorrent msg_ok "Installed Deluge" msg_info "Creating Service" cat </etc/systemd/system/deluged.service [Unit] Description=Deluge Bittorrent Client Daemon Documentation=man:deluged After=network-online.target [Service] Type=simple UMask=007 ExecStart=/opt/deluge/.venv/bin/deluged -d Restart=on-failure TimeoutStopSec=300 [Install] WantedBy=multi-user.target EOF cat </etc/systemd/system/deluge-web.service [Unit] Description=Deluge Bittorrent Client Web Interface Documentation=man:deluge-web After=deluged.service Wants=deluged.service [Service] Type=simple UMask=027 ExecStart=/opt/deluge/.venv/bin/deluge-web -d Restart=on-failure [Install] WantedBy=multi-user.target EOF systemctl enable --now -q deluged.service systemctl enable --now -q deluge-web.service msg_ok "Created Service" motd_ssh customize msg_info "Cleaning up" $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"