-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Expand file tree
/
Copy pathpyload-install.sh
More file actions
67 lines (56 loc) · 1.73 KB
/
Copy pathpyload-install.sh
File metadata and controls
67 lines (56 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/pyload/pyload
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
msg_info "Installing Dependencies"
$STD apt install -y \
unrar-free \
p7zip-full \
tesseract-ocr
msg_ok "Installed Dependencies"
UV_PYTHON="3.13" setup_uv
msg_info "Setting up pyLoad"
mkdir -p /opt/pyload_data/{userdir,downloads}
$STD uv venv --python 3.13 /opt/pyload/.venv
$STD uv pip install --python /opt/pyload/.venv --prerelease allow "pyload-ng[all]"
msg_ok "Set up pyLoad"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/pyload.service
[Unit]
Description=pyLoad Download Manager
Wants=network-online.target
After=network-online.target
[Service]
Type=simple
User=root
WorkingDirectory=/opt/pyload
ExecStart=/opt/pyload/.venv/bin/pyload --userdir /opt/pyload_data/userdir --storagedir /opt/pyload_data/downloads
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
systemctl enable -q --now pyload
msg_ok "Created Service"
msg_info "Configuring Web Interface"
for _ in {1..30}; do
[[ -f /opt/pyload_data/userdir/settings/pyload.cfg ]] && break
sleep 1
done
sed -i 's|^\([[:space:]]*ip host : "IP address"\) = localhost$|\1 = 0.0.0.0|' /opt/pyload_data/userdir/settings/pyload.cfg
# pyLoad rewrites storage_folder from --storagedir on every start; the first start seeded it.
sed -i 's| --storagedir /opt/pyload_data/downloads||' /etc/systemd/system/pyload.service
systemctl daemon-reload
systemctl restart pyload
msg_ok "Configured Web Interface"
motd_ssh
customize
cleanup_lxc