Skip to content

Commit 67c391e

Browse files
authored
qBittorrent: Switch to static builds for faster updating/upgrading (#3405)
* qBittorrent update to v5.0.4 * fixes
1 parent d621ecb commit 67c391e

File tree

2 files changed

+50
-15
lines changed

2 files changed

+50
-15
lines changed

ct/qbittorrent.sh

Lines changed: 33 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func)
3-
# Copyright (c) 2021-2025 tteck
4-
# Author: tteck (tteckster)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: tteck (tteckster) | Co-Author: Slaviša Arežina (tremor021)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://www.qbittorrent.org/
77

@@ -27,10 +27,36 @@ function update_script() {
2727
msg_error "No ${APP} Installation Found!"
2828
exit
2929
fi
30-
msg_info "Updating ${APP} LXC"
31-
$STD apt-get update
32-
$STD apt-get -y upgrade
33-
msg_ok "Updated ${APP} LXC"
30+
if [[ ! -f /opt/${APP}_version.txt ]]; then
31+
touch /opt/${APP}_version.txt
32+
mkdir -p $HOME/.config/qBittorrent/
33+
mkdir -p /opt/qbittorrent/
34+
mv /.config/qBittorrent $HOME/.config/
35+
$STD apt-get remove --purge -y qbittorrent-nox
36+
sed -i 's@ExecStart=/usr/bin/qbittorrent-nox@ExecStart=/opt/qbittorrent/qbittorrent-nox@g' /etc/systemd/system/qbittorrent-nox.service
37+
systemctl daemon-reload
38+
fi
39+
FULLRELEASE=$(curl -s https://api.github.com/repos/userdocs/qbittorrent-nox-static/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
40+
RELEASE=$(echo $FULLRELEASE | cut -c 9-13)
41+
if [[ ! -f /opt/${APP}_version.txt ]] || [[ "${RELEASE}" != "$(cat /opt/${APP}_version.txt)" ]]; then
42+
msg_info "Stopping Service"
43+
systemctl stop qbittorrent-nox
44+
msg_ok "Stopped Service"
45+
46+
msg_info "Updating ${APP} to v${RELEASE}"
47+
rm -f /opt/qbittorrent/qbittorrent-nox
48+
curl -fsSL "https://github.com/userdocs/qbittorrent-nox-static/releases/download/${FULLRELEASE}/x86_64-qbittorrent-nox" -o /opt/qbittorrent/qbittorrent-nox
49+
chmod +x /opt/qbittorrent/qbittorrent-nox
50+
echo "${RELEASE}" >/opt/${APP}_version.txt
51+
msg_ok "Updated $APP to v${RELEASE}"
52+
53+
msg_info "Starting Service"
54+
systemctl start qbittorrent-nox
55+
msg_ok "Started Service"
56+
msg_ok "Updated Successfully"
57+
else
58+
msg_ok "No update required. ${APP} is already at v${RELEASE}"
59+
fi
3460
exit
3561
}
3662

@@ -41,4 +67,4 @@ description
4167
msg_ok "Completed Successfully!\n"
4268
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
4369
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
44-
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8090${CL}"
70+
echo -e "${TAB}${GATEWAY}${BGN}http://${IP}:8090${CL}"

install/qbittorrent-install.sh

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env bash
22

3-
# Copyright (c) 2021-2025 tteck
4-
# Author: tteck (tteckster)
3+
# Copyright (c) 2021-2025 community-scripts ORG
4+
# Author: tteck (tteckster) | Co-Author: Slaviša Arežina (tremor021)
55
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
66
# Source: https://www.qbittorrent.org/
77

@@ -13,10 +13,14 @@ setting_up_container
1313
network_check
1414
update_os
1515

16-
msg_info "Installing qbittorrent-nox"
17-
$STD apt-get install -y qbittorrent-nox
18-
mkdir -p /.config/qBittorrent/
19-
cat <<EOF >/.config/qBittorrent/qBittorrent.conf
16+
msg_info "Setup qBittorrent-nox"
17+
FULLRELEASE=$(curl -s https://api.github.com/repos/userdocs/qbittorrent-nox-static/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }')
18+
RELEASE=$(echo $FULLRELEASE | cut -c 9-13)
19+
mkdir -p /opt/qbittorrent
20+
curl -fsSL "https://github.com/userdocs/qbittorrent-nox-static/releases/download/${FULLRELEASE}/x86_64-qbittorrent-nox" -o /opt/qbittorrent/qbittorrent-nox
21+
chmod +x /opt/qbittorrent/qbittorrent-nox
22+
mkdir -p $HOME/.config/qBittorrent/
23+
cat <<EOF >$HOME/.config/qBittorrent/qBittorrent.conf
2024
[LegalNotice]
2125
Accepted=true
2226
@@ -26,16 +30,21 @@ WebUI\Port=8090
2630
WebUI\UseUPnP=false
2731
WebUI\Username=admin
2832
EOF
29-
msg_ok "qbittorrent-nox"
33+
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
34+
msg_ok "Setup qBittorrent-nox"
3035

3136
msg_info "Creating Service"
3237
cat <<EOF >/etc/systemd/system/qbittorrent-nox.service
3338
[Unit]
3439
Description=qBittorrent client
3540
After=network.target
41+
3642
[Service]
37-
ExecStart=/usr/bin/qbittorrent-nox
43+
Type=simple
44+
User=root
45+
ExecStart=/opt/qbittorrent/qbittorrent-nox
3846
Restart=always
47+
3948
[Install]
4049
WantedBy=multi-user.target
4150
EOF

0 commit comments

Comments
 (0)